<template>
  <div v-if="liveInfo" @click="otherClick" class="c-p c-flex-column c-h c-minh theme-live-room theme-platform-custom" :class="{'theme-market': isMarketing}">
    <live-detail-cover ref="liveDetailCover" :liveInfo="liveInfo" @spreadInvite="spreadInvite" @cvoverLiveRoom="cvoverLiveRoom" @liveRemind='liveRemind' @upDateisShowFixedBook="upDateisShowFixedBook"></live-detail-cover>
    <article class="c-h0 c-flex-grow1 c-flex-column" :class="isRecommendShow?'c-pz2':''">
      <!-- 营销活动倒计时 -->
      <flash-sales-time-new v-if="isMarketing"
        :type="liveInfo.sales? 'isSale':liveInfo.isFriendHelper ? 'isFa' : liveInfo.bargain ? 'isBargain' : 'isCollage'"
        :price="liveInfo.sales ? liveInfo.sales.price : liveInfo.collage ? liveInfo.collage.captainPrice : liveInfo.bargain ? liveInfo.bargain.reservePrice : ''"
        :from="liveInfo.collage && liveInfo.collage.collageGroupType == 2 ? 'activity' : ''"
        :startTime="liveInfo.sales ? liveInfo.sales.sales.startTime : liveInfo.bargain ? liveInfo.bargain.startTime : liveInfo.collage ? liveInfo.collage.startTime : liveInfo.faStartAt"
        :endTime="liveInfo.sales ? liveInfo.sales.sales.endTime : liveInfo.bargain ? liveInfo.bargain.endTime : liveInfo.collage ? liveInfo.collage.endTime : liveInfo.faEndAt"
        :originalPrice="liveInfo.price"
        :stock="liveInfo.sales ? liveInfo.sales.balance: ''"
        :stockBargain="liveInfo.bargain && liveInfo.bargain.stock"
        :isLimit="liveInfo.sales && liveInfo.sales.limit == 0 || (liveInfo.bargain && liveInfo.bargain.isLimitStock == 2) ? false : true"
        :salesTag="liveInfo.sales && liveInfo.sales.sales.tags"
        :peopleNum="liveInfo.collage && liveInfo.collage.peopleNum"
        :isPreheat="liveInfo.bargain && liveInfo.bargain.isPreheat"
        :bargainStatus="liveInfo.bargain && liveInfo.bargain.status"
        :optimal="optimal"
        @showCoupon="showCoupon = true"
        @falshSalesTime="falshSalesTime"
        @finishFlashSales="finishFlashSales"
      >
      </flash-sales-time-new>
      <section class="c-p" v-if="liveInfo != ''">
        <div class="c-bd-b12-f5">
          <!-- 非营销 && 单卖 && (未购买 || 已经购但属于试看阶段) -->
          <price-bar class="c-ph0"  :class="isRecommendShow ? '': 'c-pt20'" v-if="!isMarketing && liveInfo.isSaleOnly == 1 && (!liveInfo.isBuyed||(liveInfo.isBuyed == 1 && liveInfo.permissionType == 45))"
            :isFlat="true"
            :showTryLook="showTryLook"
            :styleType="2"
            :dataInfo="liveInfo"
            :recType="recType"
            :chainInfo="chainInfo"
          >
          </price-bar>
          <!-- 付费 && 单卖 && 非IOS && (没有权限或者已有权限（处于试看状态) -->
          <discount-info class="c-mt8" v-if="liveInfo.payType == 2&& liveInfo.isSaleOnly == 1 && !isiOS && (!liveInfo.isBuyed||(liveInfo.isBuyed == 1 && liveInfo.permissionType == 45))"
            :couponList="couponList"
            :dataInfo="liveInfo"
            :chainInfo="chainInfo"
            :isMarketing="isMarketing"
            @clickShowCoupon="showCoupon = true"
          >
          </discount-info>
          <vip-entry class="c-ph24 c-mt20"
            v-if="(!liveInfo.isFriendHelper || companyAuth.enableFriendHelper == 0) &&liveInfo.isSaleOnly == 1 &&(!liveInfo.isBuyed||(liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)) && !$isWxAppIos() && !isiOS"
            :dataInfo="liveInfo"
          ></vip-entry>
          <div v-if="!isRecommendShow || (isRecommendShow && liveInfo.hasPermission)" class="c-ph24  c-mt24">
            <span v-if="showTryLook" class="try-look-tag c-vcAlign-middle">可试看</span>
            <span class="c-fs30 c-fc-xblack c-lh48 c-fw-b c-wb-ba">{{liveInfo.name}}</span>
          </div>
          <div class="c-ph24 c-pt24 c-pb30 c-flex-row c-fc-gray c-fs20 c-justify-sb">
            <div class="c-flex-row c-aligni-center">
              <span v-if="liveInfo.isShowViewers==1" class="c-mr24"><i class="iconfont c-fs20 c-mr8">&#xe6bb;</i>{{liveInfo.groupNum}}人次观看</span>
              <i class="iconfont c-fs20 c-mr8" v-if="!(liveInfo.status==2 || liveInfo.status==4)">&#xe70f;</i>
              <!-- 优先显示开始直播，如果直播结束，直播权限来源至其他产品，比如训练营，则优先显示训练营权限有效期，否则显示直播回放有效期 -->
              <span v-if="!(liveInfo.status==2 || liveInfo.status==4)">{{liveInfo.startAt}}开始直播</span>
            </div>
          </div>
          <!-- 引导入群 -->
          <invite-group class="c-pr24 c-pb20"
            v-if="(liveInfo.isBuyed == 1 && liveInfo.permissionType != 45 && liveInfo.guideData && liveInfo.guideData.isOpenGuide == 1 && liveInfo.guideData.guideType.includes(1))"
            :guideText="liveInfo.detailGuideTitle"
            @handleShowGuidePop="handleShowGuidePop"
          >
          </invite-group>
          <bargain-rules class="c-bd-t12-f5" v-if="liveInfo.bargain != null &&(!liveInfo.isBuyed||(liveInfo.isBuyed == 1 && liveInfo.permissionType == 45))" :isPreheat="liveInfo.bargain.isPreheat" :status="liveInfo.bargain.status"></bargain-rules>
        </div>
        <div class="c-bd-b12-f5  c-flex-row c-aligni-center c-justify-sb c-pv30 c-ph24" v-if="liveInfo.userRole < 2&&(liveInfo.effectiveProd||liveInfo.liveValidTime)&&((liveInfo.isSaleOnly==0&&liveInfo.isSaleTogether==1&&liveInfo.hasPermission)||(liveInfo.isSaleOnly==1))">
          <div class="c-fs26 c-fc-xblack c-fw600">直播有效期</div>
          <valid-time-com v-if="liveInfo && liveInfo.effectiveProd" :dataInfo="liveInfo" :prodId="liveInfo.id" :prodType="51" :isShowModal="false" @openValidTimeDesc="openValidTimeDesc"></valid-time-com>
          <span class="c-fs24 theme-fc" v-else-if="liveInfo.liveValidTime">{{liveInfo.liveValidTime}}</span>
        </div>
        <!-- 非强制表单入口 -->
        <formEntry v-if="liveInfo.hasPermission &&
                     (liveInfo.isOpenFormCollection==1&&liveInfo.userRole<2&&
                       ((liveInfo.collectPage==3&& liveInfo.isRelForm == true && liveInfo.hasFormLog == false && isShowFormlg)||(liveInfo.hasFormLog&&liveInfo.enableEdit==2&& isShowFormlg&& liveInfo.isRelForm == true)))"
          relType="9"  :relId="liveId"  :dataInfo="liveInfo"
          classObject="c-fs22" fontSizeClass="c-fs20" iconSizeClass="c-fs14" topClass="c-bd-b12-f5"
          @goForm="goForm" ></formEntry>

        <!-- <div class="c-bd-b16 bargain-style" v-if="liveInfo.bargain != null && !liveInfo.isBuyed">
          </div> -->
        <!-- <section
          v-if="liveInfo.isBuyed == 1 && liveInfo.guideData && liveInfo.guideData.isOpenGuide == 1 && liveInfo.guideData.guideType.includes(1)"
          @click="handleShowGuidePop()"
          class="c-mh24 c-mb30 c-pl16 c-pr20 c-hh64 c-fs24 camp-guide c-flex-row c-aligni-center"
        >
          <img class="c-ww52 c-hh32" :src="require('../../../assets/i/wap/course/group_guide.png')" alt="">
          <div class="c-w0 c-flex-grow1 c-fc-xblack c-fw600 c-pl16">{{ liveInfo.detailGuideTitle }}</div>
          <div class="iconfont c-fs40 fc-3F73F8">&#xe986;</div>
        </section> -->
        <collage-persons-list class="c-p c-bd-b12-f5" v-if="liveInfo && liveInfo.isBuyed == 0 && liveInfo.collage && (liveInfo.collage.status == 2 || liveInfo.collage.status == 1)" :collage="liveInfo.collage" @startCollage="goCollageDetail(-1,dataInfo.collage.collageId)" @goCollageDetail="gcd"></collage-persons-list>
        <collocation-buy-com :prodInfo="{prodType: 51, prodId: lId}" :relateCollocationArr="relateCollocation"></collocation-buy-com>
        <more-device class="c-bd-b12-f5" :positionType="1" :prodInfo="{prodType: 51, prodId: liveId, socialRoomId: liveInfo.jGRoomId, liveType:this.liveInfo.liveType}" v-if="showMoreDevice"></more-device>
      </section>
      <div class="c-hh76" id="tabhBar">
        <my-small-tabbar class="c-bg-white c-hh76 c-bd-b1-f6 c-ph24" :styleType="2" :class="tabhBarFixed == true ? isiOS ? 'tab-bar-ios' : ($isWxApp() ? 'tabhBar c-wx-top0' : 'tabhBar')  : ''" :tabList="tabList" :tabIndex="typeBar" @changeTab="changeType"></my-small-tabbar>
      </div>
      <!-- <my-small-tabbar id="tabhBar" :styleType="2" :tabList="tabList" :tabIndex="typeBar" @changeTab="changeType" class="tabhBar" flexClass="c-justify-start" :class="tabList.length == 1 ? 'one':''"></my-small-tabbar> -->
      <div class="c-pb60 c-minh640" v-show="typeBar==1">
        <div class="c-mh24 teacher-info c-p c-br20" :class="item.intro ? 'has-intro':''" v-for="(item,index) in teacherList" :key="index">
          <div class="c-flex-row   item-avatar" :class="item.intro ? 'c-aligni-end':'c-aligni-center'">
            <img v-lazy="item.avatar || require('../../../assets/defult_head.png')" class="c-ww80 c-hh80 c-brp50" />
            <p class="c-fs26 c-fc-xblack c-ml20 c-fw500">{{item.realName?item.realName:item.userName || '未知'}}</p>
          </div>
          <div v-if="item.intro" class="c-fs24 c-fc-sblack c-pl20 c-pr20 c-pt10 c-pb30 c-p c-ml20 c-mr20 c-mb20">{{item.intro}}</div>
        </div>
      </div>
      <!-- 评价 -->
      <div v-show="typeBar==5">
        <live-comment ref="liveComment" class="c-minh640" :prodId="liveId" :prodType="51" @updateCommentCount="updateCommentCount"></live-comment>
      </div>
      <div class="c-ph24" v-show="typeBar==0">
        <div v-if="liveInfo.intro" @click="clickDesc" class="c-mt28 tinymce-text c-minh640 c-ww-bw c-ww-ba c-contexty-scroll" v-html="liveInfo.intro" :class="[cfg.isCopyPicture == 0 ? 'closeBig' : 'aCloseBig', cfg.isCopy == 0 ? 'copyNot' : '']"></div>
        <loading-status-tem :noData="liveInfo.intro == ''" :noDataText="'暂无内容'" noDataStyle="padding: 0px" :class="liveInfo.intro == '' ? 'c-bg-white c-hh640 c-flex-column c-flex-center' : ''"></loading-status-tem>
      </div>
      <div class="c-ph24 c-minh640" v-show="typeBar==3">
        <div class="c-flex-row c-pt30" v-for="(item,index) in signColumns" :key="index" @click="goSignColumns(item.id)">
          <div class="c-ww150 c-hh75 c-text-hidden c-br8 c-p">
            <div class="c-pa c-p-t0 c-p-l0 c-br-br8 c-flex-row c-flex-center c-translucent-balck60 c-fc-white c-fs16 c-ph8 c-hh24">打卡</div>
            <img :src="$addXossFilter(item.cover, require('@/assets/activity_defult.png'))" class="c-w100 c-br8" alt="">
          </div>
          <div class="c-flex-grow1 c-w0 c-flex-row c-aligni-center c-pb30 c-pl20" :class="index == signColumns.length - 1? '':'c-bd-b1'">
            <div class="c-flex-grow1 c-w0 c-pr20 c-hh75 c-flex-column c-justify-sb">
              <div class="c-fs24 c-fw400 c-text-ellipsis1">
                {{item.name}}
              </div>
              <div class="theme-fc c-fs20 c-flex-row c-aligni-center">
                {{item.number}}人参与
              </div>
            </div>
            <i class="iconfont c-fs16 c-fc-sgray">&#xe85a;</i>
          </div>
        </div>
      </div>
      <div v-show="typeBar==4&&companyAuth.enableComboModule == 1">
        <div v-if="packageList.length > 0 && companyAuth.enableComboModule == 1">
          <package-index-com :islive='1' res="package" @clickALLMore='showPackageList' class="c-minh640" :showAll="true" :styleType="2" :isNewRelatedStyle="true" :proType="8" :proId="lId" :isHomePage="false" :packageList="packageList"></package-index-com>
        </div>
        <loading-status-tem :noData="packageList.length==0" :noDataText="'暂无内容'" noDataStyle="padding: 0px" :class="packageList.length==0 ? 'c-bg-white c-hh640 c-flex-column c-flex-center' : ''"></loading-status-tem>
      </div>
      <bottom-company-info v-if="companyAuth" :showInfo="companyAuth.enableShowInfo == 1 || companyAuth.liveAnnual == 1" :showDefaultText="companyAuth.liveAnnual == 1"></bottom-company-info>
    </article>
    <!-- <more-device :positionType="2" :prodInfo="{prodType: 51, prodId: liveId, socialRoomId: liveInfo.jGRoomId, liveType:this.liveInfo.liveType}" v-if="showMoreDevice"></more-device> -->
    <section v-if="typeBar==5&&(liveInfo.isBuyed && liveInfo.permissionType != 45)" class=" c-flex-row c-pl32 c-pr24 c-aligni-center c-justify-sb c-bd-t1 c-hh88 c-pf c-p-b0 c-w100 c-maxw640 c-bg-white c-pz1">
      <div class="c-flex-grow1 c-flex-row c-aligni-center c-justify-end c-w0">
        <div class="theme-bg c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-br36 c-fs28" @click="setComment">{{liveInfo.userHasComment?'修改评价':'我也要评价'}}</div>
      </div>
    </section>
    <bottom-buy-com v-else
      :ckFrom="51"
      :isNeedPay="(!liveInfo.isBuyed||(liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)) && ((liveInfo.isSaleOnly == 1 && (liveInfo.payType == 2 && liveInfo.price * 1 > 0)) || (liveInfo.isSaleOnly != 1 && liveInfo.isSaleTogether == 1))"
      :showNotSale="liveInfo.isSaleOut == 0 && liveInfo.payType != 3 && liveInfo.status != 3 && ((liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)||liveInfo.isBuyed == 0) && liveInfo.price * 1 > 0"
      :notSale="liveInfo.isSaleOut == 0"
      :showFriendHelper="((liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)||liveInfo.isBuyed == 0) && companyAuth.enableFriendHelper == 1 && liveInfo.isFriendHelper"
      :friendHelperStatus="faStatus"
      :showBuyButton="liveInfo.payType != 3 && liveInfo.status != 3 && ((liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)||liveInfo.isBuyed == 0) && liveInfo.price * 1 > 0"
      :isNew="true"
      :isUserGroupUrl="((liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)||liveInfo.isBuyed == 0) && liveInfo.isUserGroup == 1 && liveInfo.isInUserGroups != 1&&liveInfo.userGroupUrl!='' && isAuthByStoreOrg"
      @spreadInvite="spreadInvite"
      @invitePoster="invitePoster"
      @goHelpDetail="goHelpDetail"
      @backPackage="backPackage"
      @showBelongCourse="showPackageList"
      @handleClickDetail="handleClickDetail"
      class="c-p c-pz2"
    >
      <div v-if="liveInfo.status== 4" class="c-bg-ccc c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-br36 c-fs28">回放已过期</div>
      <!-- 直播已结束 -->
      <div v-else-if="liveInfo.status == 3" class="c-bg-b3 c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-br36 c-fs28 c-bd1">直播已结束</div>
      <!-- 没有权限 || 已有权限（在是看阶段） -->
      <div v-else-if="((liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)||liveInfo.isBuyed == 0) && liveInfo.isUserGroup == 1 && liveInfo.isInUserGroups != 1" class="c-bg-ccc c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-br36 c-fs28">{{liveInfo.userGroupBottom?liveInfo.userGroupBottom:liveInfo.payType == 2 ? '仅指定用户可购买' : '仅指定用户可观看'}}</div>
      <div v-else-if="((liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)||liveInfo.isBuyed == 0) && !isAuthByStoreOrg" class="c-bg-ccc c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-br36 c-fs28">{{liveInfo.userGroupBottom?liveInfo.userGroupBottom:liveInfo.payType == 2 ? '仅指定组织成员可购买' : '仅指定组织成员可观看'}}</div>
      <div v-else-if="liveInfo.isSaleTogether==1&&liveInfo.isSaleOnly != 1&&!liveInfo.hasPermission" class="c-flex-column c-aligni-center theme-fc theme-bg-10 c-hh64 c-justify-sa c-w100 theme-bd1 c-br32" @click="showPackageList">
        <span class="c-fs28 c-lh">所属课程</span>
      </div>
      <div v-else class="btn-wrap c-fs28 c-lh c-w0 c-flex-grow1 c-flex-row">
        <div v-if="liveInfo.isSaleTogether==1&&(!isMarketing||(liveInfo.sales && liveInfo.sales.sales.status == 2))" class="c-hh64 c-flex-row c-flex-center c-w0 c-flex-grow1" @click="showPackageList">
          <span class="c-fs28 c-lh">所属课程</span>
        </div>
        <div v-if="liveInfo.sales && liveInfo.sales.sales.status == 2 && (((liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)||liveInfo.isBuyed == 0) && liveInfo.price * 1 > 0)" @click="clickBuy" class="theme-bg c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-fs28">{{getBuyBtnTitle}}</div>
        <!-- 未购买，需要输入密码 -->
        <div v-else-if="liveInfo.existPlayLog == 0 && liveInfo.payType == 3 && liveInfo.isBuyed == 0" @click="clickEnterPwd" class="theme-bg c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-fs28">输入密码进入</div>
        <!-- 未购买，并且价格不为0 -->
        <template v-else-if="((liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)||liveInfo.isBuyed == 0) && liveInfo.price * 1 > 0">
          <div @click="clickBuy" v-if="!((liveInfo.isFriendHelper == true && companyAuth.enableFriendHelper == 1) ||
            (liveInfo.collage && (liveInfo.collage.status == 2 || liveInfo.collage.status == 1))||
            (liveInfo.bargain && ((liveInfo.bargain.status == 1 && liveInfo.bargain.isPreheat == 1) || liveInfo.bargain.status == 2)))"
            class="c-hh64 c-flex-column c-flex-center c-w0 c-flex-grow1">
            <span class="c-fs28 c-lh">立即购买</span>
          </div>
          <div v-if="liveInfo.collage && (liveInfo.collage.status == 2 || liveInfo.collage.status == 1) && liveInfo.collage.userType != -1" class="c-hh64 c-flex-row c-flex-center c-w0 c-flex-grow1" @click="goCollageDetail(liveInfo.collage.groupId,liveInfo.collage.collageId)">
            拼团中...
          </div>
          <template v-else-if="((liveInfo.isFriendHelper == true && companyAuth.enableFriendHelper == 1) ||
            (liveInfo.collage && (liveInfo.collage.status == 2 || liveInfo.collage.status == 1))||
            (liveInfo.bargain && ((liveInfo.bargain.status == 1 && liveInfo.bargain.isPreheat == 1) || liveInfo.bargain.status == 2)))">
            <div class="c-flex-column c-hh64 c-aligni-center c-fc-white c-justify-center c-w100 theme-bg" @click="clickBuy">
              <span class="c-fs20 c-lh">立即购买</span>
              <span class="c-fs22 c-lh c-mt4"><span class="c-fs20">{{'￥' | iosPriceFilter()}}</span>{{calculationPrice}}</span>
            </div>
            <div v-if="companyAuth.enableFriendHelper == 1 && liveInfo.isFriendHelper == true" class="c-flex-row c-flex-center c-fc-white c-w100 c-hh64" :class="faStatus == 2 ? 'theme-bg' : 'c-bg-d7'" @click="goHelpDetail()">
              <span class="c-fs20 c-lh">灌溉领取</span>
            </div>

            <div v-if="liveInfo.collage && (liveInfo.collage.status == 2 || liveInfo.collage.status == 1) && liveInfo.collage.userType == -1" class="c-hh64 c-flex-column c-aligni-center c-fc-white c-justify-center c-w100" :class="liveInfo.collage.status == 2 ? 'theme-bg' : 'c-bg-d7'" @click="goBuy(-1,liveInfo.collage.collageId)">
              <span class="c-fs20 c-lh">发起拼团</span>
              <span class="c-fs22 c-lh c-mt4"><span class="c-fs20">{{'￥' | iosPriceFilter('Live')}}</span>{{Number(liveInfo.collage.captainPrice).toFixed(2)}}</span>
            </div>
            <!-- 砍价信息不为空 -->
            <!-- 未发起砍价 -->
            <template v-if="liveInfo.bargain != null && ((liveInfo.bargain.status == 1 && liveInfo.bargain.isPreheat == 1) || liveInfo.bargain.status == 2)&&liveInfo.bargain.userType == 1">
              <div class="c-hh64 c-flex-column c-aligni-center c-fc-white c-justify-sa c-w100 theme-bg" @click="handleClickBargainDetail(liveInfo.bargain.bargainId)">正在砍价</div>
            </template>
            <template v-if="liveInfo.bargain != null && ((liveInfo.bargain.status == 1 && liveInfo.bargain.isPreheat == 1) || liveInfo.bargain.status == 2)&&liveInfo.bargain.userType == -1">
              <div class="c-hh64 c-flex-column c-aligni-center c-fc-white c-justify-center c-w100" :class="(liveInfo.bargain.status == 1 && liveInfo.bargain.isPreheat == 1) ? 'c-bg-d7' : 'theme-bg-gradient'" @click="handleClickBargainDetail(liveInfo.bargain.bargainId)">
                <span class="c-fs20 c-lh">砍价享</span>
                <span class="c-fs22 c-lh c-mt4"><span class="c-fs20">{{'￥' | iosPriceFilter}}</span>{{Number(liveInfo.bargain.reservePrice).toFixed(2)}}</span>
              </div>
            </template>
          </template>
        </template>
        <!-- 已购买或价格为0 并且直播状态为回放 -->
        <div v-else-if="liveInfo.status == 2" @click="goLiveRoom" class="theme-bg c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-fs28">直播回放</div>
        <!-- 已购买或价格为0 ，直播状态为预告或正在直播 -->
        <div v-else-if="(liveInfo.payType==1||liveInfo.price==0)&&liveInfo.isSaleOnly == 1&& liveInfo.payType != 3&&liveInfo.status == 0&&liveInfo.isShowRemind&& liveInfo.userRole < 2" @click="goStartNockLiveRoom" class="theme-bg c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-fs28">{{isSet==0?'预约直播':'进入直播间'}}</div>
        <!-- 已购买或价格为0 ，直播状态为预告或正在直播 -->
        <div v-else @click="goLiveRoom" class="theme-bg c-fc-white c-lh c-w0 c-flex-grow1 c-flex-row c-flex-center c-hh64 c-fs28">进入直播间</div>
        <!--  -->
      </div>
      <!-- <template v-else>
        <div class="c-flex-row c-hh64 c-br32 theme-bd1 c-ml16 c-w0 c-flex-grow1">
          <div v-if="liveInfo.isSaleTogether==1" class="c-flex-column c-aligni-center theme-fc c-justify-sa c-w100" @click="showPackageList">
            <span class="c-fs28 c-lh">所属课程</span>
          </div>
          <div :class="liveInfo.isSaleTogether == 0?'c-br32':'c-br-br32 c-br-tr32'" class="c-flex-column c-aligni-center c-fc-white c-justify-sa c-w100 theme-bg-gradient" v-if="liveInfo.sales && liveInfo.sales.sales.status == 2 && (((liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)||liveInfo.isBuyed == 0) && liveInfo.price * 1 > 0)"> -->
      <!-- 限时购 -->
      <!-- <span class="c-fs28 c-lh" @click="clickBuy">立即抢购</span>
          </div>
          <div @click="clickEnterPwd" :class="liveInfo.isSaleTogether == 0?'c-br32':'c-br-br32 c-br-tr32'" class="theme-bg c-flex-column c-aligni-center c-fc-white c-justify-sa c-w100 c-bg-d7" v-else-if="liveInfo.existPlayLog == 0 && liveInfo.payType == 3 && ((liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)||liveInfo.isBuyed == 0)"> -->
      <!-- 未购买，需要输入密码 -->
      <!-- <span class="c-fs28 c-lh" >输入密码进入</span>
          </div> -->
    <!-- 未购买价格大于0 -->
    <!-- <div :class="[liveInfo.isSaleTogether == 0?'c-br32':'c-br-br32 c-br-tr32', showMarketingBar ? 'theme-bg-gradient' : 'theme-bg']" class="c-flex-column c-aligni-center c-fc-white c-justify-sa c-w100 c-p" v-else-if="liveInfo.status != 3&&((liveInfo.isBuyed == 1 && liveInfo.permissionType == 45)||liveInfo.isBuyed == 0) && liveInfo.price * 1 > 0"> -->
      <!-- 非营销 -->
      <!-- <span @click="clickBuy" v-if="!((liveInfo.isFriendHelper == true && companyAuth.enableFriendHelper == 1) ||
              (liveInfo.collage && (liveInfo.collage.status == 2 || liveInfo.collage.status == 1))||
              (liveInfo.bargain && ((liveInfo.bargain.status == 1 && liveInfo.bargain.isPreheat == 1) || liveInfo.bargain.status == 2)))"
              class="c-fs28 c-lh ">
              立即购买
            </span>
            <span v-else class="c-flex-column c-aligni-center c-fc-white c-justify-sa c-w100 c-p">
              <span v-if="liveInfo.collage && (liveInfo.collage.status == 2 || liveInfo.collage.status == 1) && liveInfo.collage.userType != -1" class="c-fs28 c-lh" @click="goCollageDetail(liveInfo.collage.groupId,liveInfo.collage.collageId)">
                拼团中...
              </span>
              <span @click.stop="popMarketingBuy" v-else class="c-fs28 c-lh">
                {{liveInfo.collage||liveInfo.bargain?'购买':liveInfo.isFriendHelper?'灌溉领取':''}}
                <marketing-buy-btn
                  v-if="liveInfo.collage && (liveInfo.collage.status == 2 || liveInfo.collage.status == 1)"
                  :isCollage="true"
                  :showMarketingBuyBtn="showMarketingBuyBtn"
                  :calculationPrice="calculationPrice"
                  :marketingPrice="Number(liveInfo.collage.captainPrice).toFixed(2)"
                  :btnActivate="liveInfo.collage.status == 1 ? false : true"
                  @clickBuyNow="clickBuy"
                  @marketingBuy="goBuy(-1,liveInfo.collage.collageId)">
                </marketing-buy-btn>
                <marketing-buy-btn
                  v-if="companyAuth.enableFriendHelper == 1 && liveInfo.isFriendHelper == true"
                  :isFriendHelp="true"
                  :showMarketingBuyBtn="showMarketingBuyBtn"
                  :calculationPrice="calculationPrice"
                  :btnActivate="faStatus == 2 ? true : false"
                  @clickBuyNow="clickBuy"
                  @marketingBuy="goHelpDetail">
                </marketing-buy-btn>
                <marketing-buy-btn
                  v-if="liveInfo.bargain != null && ((liveInfo.bargain.status == 1 && liveInfo.bargain.isPreheat == 1) || liveInfo.bargain.status == 2)"
                  :isBargain="true"
                  :showMarketingBuyBtn="showMarketingBuyBtn"
                  :calculationPrice="calculationPrice"
                  :marketingPrice="Number(liveInfo.bargain.reservePrice).toFixed(2)"
                  :btnActivate="(liveInfo.bargain.status == 1 && liveInfo.bargain.isPreheat == 1) ? false : true"
                  :isBargaining="liveInfo.bargain.userType == 1 ? true : false"
                  @clickBuyNow="clickBuy"
                  @marketingBuy="handleClickBargainDetail(liveInfo.bargain.bargainId)">
                </marketing-buy-btn>
              </span>
            </span>
          </div> -->
      <!-- 已购买或价格为0 并且直播状态为回放 -->
      <!-- <div v-else-if="(liveInfo.isBuyed != 0&&!(liveInfo.isBuyed == 1 && liveInfo.permissionType == 45))&&liveInfo.status == 2" @click="goLiveRoom" :class="liveInfo.isSaleTogether == 0?'c-br32':'c-br-br32 c-br-tr32'" class="c-fs28 c-flex-column c-aligni-center c-fc-white c-justify-sa c-w100 theme-bg c-p">直播回放</div> -->
      <!-- 已购买或价格为0 ，直播状态为预告或正在直播 -->
      <!-- <div v-else-if="(liveInfo.isBuyed != 0&&!(liveInfo.isBuyed == 1 && liveInfo.permissionType == 45))&&(liveInfo.status == 0||liveInfo.status == 1)" @click="goLiveRoom" :class="liveInfo.isSaleTogether == 0?'c-br32':'c-br-br32 c-br-tr32'" class="c-fs28 c-flex-column c-aligni-center c-fc-white c-justify-sa c-w100 theme-bg c-p">进入直播间</div> -->
      <!--  -->
      <!-- </div>
      </template> -->
    </bottom-buy-com>
    <!-- 关联弹窗 -->
    <related-list :liveId="liveId" :showType="0" @closeCombo="closeCombo" :showCombo="showCombo"></related-list>
    <!-- 直播情况特殊，上面那个有效期组件被套在overflow：scroll中，会导致遮罩盖不到封面部分，所以使用两个有效期组件，一个显示文本，一个弹窗 -->
    <valid-time-com ref="validTime" v-if="liveInfo && (liveInfo.status==2 || liveInfo.status==4) && liveInfo.effectiveProd" :dataInfo="liveInfo" :prodId="liveId" :prodType="51" :isShowDateAndTime="false"></valid-time-com>
    <cj-popup v-model="showEnterPcTip" round :closeable="true" close-icon-position="bottom-center" close-icon="icon-shanchu" @closed="showEnterPcTip=false">
      <div class="c-flex-column c-bg-sgray c-flex-center c-pb48 c-br20 c-p c-ww540">
        <div class="c-pt40 c-pb60 c-bg-white c-w100 c-flex-row c-flex-center border-r-lr20">
          <div @click="clickEnterRoom" class="theme-bg-gradient c-ww480 c-hh64 c-flex-row c-flex-center c-fc-white c-fs28 c-br36">进入直播间</div>
        </div>
        <img class="c-ww110 c-hh130" src="https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/assets/i/wap/socail/icon_enter.png" alt="" />
        <div class="c-fs28 c-pt20">恭喜你，获得进入PC端直播间的权限！</div>
        <div class="c-pt20 c-pb10 c-fs22 c-fc-sblack">PC直播间：</div>
        <div class="c-pb30 c-fs22 c-fc-sblack">在PC端用谷歌浏览器打开下</div>
        <div @click="copyText" class="c-ww200 c-hh56 theme-bg-gradient c-flex-row c-flex-center c-fc-white c-fs22 c-br30">复制链接</div>
        <!-- <div @click="showEnterPcTip=false" class="c-ww60 c-opacity50" style="position: absolute;bottom:-2.5rem;z-index:9999;left:50%;transform: translateX(-50%);">
          <i class="iconfont c-fs56 c-fc-white">&#xe84e;</i>
        </div> -->
      </div>
    </cj-popup>
    <!-- 入群引导 -->
    <group-guidance ref="guidance" :isType="false" :groupObject="liveInfo.guideData" :startAt="liveInfo.startAt"></group-guidance>
    <share-masker :isShowShare="isShowShare" v-if="isShowShare" @closeShare="isShowShare=false;"></share-masker>
    <comfirm-com :showPassword="showPassword" :noticeText="noticeText" :text="'输入密码进入直播'" :placeholderText="'请输入密码'" @changePsw="changePsw" @closePassword="showPassword = false" @submitPassword="submitPassword"></comfirm-com>
    <coupon-list-com
      @closeModal="closeModal"
      @getCouponList="getCouponList"
      :couponIsPage="couponIsPage"
      :couponLoading="couponLoading"
      :couponList="couponList"
      :showCoupon="showCoupon"
      :prodId="Number(lId)"
      :prodType="51"
      :isMarketing="isMarketing"
      :dataInfo="liveInfo"
      :chainInfo="chainInfo"
    >
    </coupon-list-com>
    <show-integrate :showIntegrate="showIntegrate" :integrateCount="integrateCount" v-if="showIntegrate" @closeShareInt="showIntegrate=false;"></show-integrate>
    <!-- 推荐有礼 -->
    <recommend-present ref="recommendPresent"></recommend-present>
    <img v-if="showTryLook" @click="clickTryLook(liveInfo)" class="c-ww92 c-hh90 c-pf c-p-r24 c-p-b160 c-pz10 coms-live-iframe-none" :src="require('@/assets/i/wap/live/tryLook.png')" alt="">
    <offical-account v-if="liveInfo && liveInfo.bargain" :showAccountQcode="showAccountQcode" :desc="officalDesc" :imgSrc="$addXossFilter(mpQrcode)" @hideDialog="hideDialog"></offical-account>
    <recommend-award v-if="liveInfo.recommend && liveInfo.recommend.isExist" :action="liveInfo.recommend && liveInfo.recommend.action"></recommend-award>
    <promote-income v-if="showProtoIncome && liveInfo && liveInfo.isSaleOut != 0 && showProcessBar"
      :showInvitionCard="!liveInfo.isFriendHelper && !(liveInfo.collage && (liveInfo.collage.status == 2 || liveInfo.collage.status == 1)) && !liveInfo.sales && !liveInfo.bargain && liveInfo.isInvitionCard && (liveInfo.recommend.isExist == 0)"
      :showMarketingCard="liveInfo.isFriendHelper || (liveInfo.collage && (liveInfo.collage.status == 2 || liveInfo.collage.status == 1)) || liveInfo.sales || liveInfo.bargain"
      :prodId="lId"
      :prodType="51"
      @goInvite="spreadInvite"
      @goMarketingPoster="invitePoster"
    >
    </promote-income>
    <!-- 入学证书 -->
    <enrol-cer :isReceivedStudy="isReceivedBuy" ref="enrolcerCom" :bigType="2"></enrol-cer>
    <!-- 防录屏弹窗提示 -->
    <screen-recording-setting :recordingSetting="recordingSetting" :prodInfo="{prodType:51}" :showWeaAppDialog="showWeaAppDialog" @closeWeaAppDialog="showWeaAppDialog = false"></screen-recording-setting>
    <collage-grades ref="collageGrades" :relType='9' :refereeId="refereeId" :isRelForm="liveInfo.isRelForm && !liveInfo.hasFormLog" :extId="liveInfo.id" :bindPhoneSetting="bindPhoneSetting" :goodsRoomId="goodsRoomId" :dataInfo="liveInfo"></collage-grades>
    <live-comment-set ref="liveCommentSet" :prodType="51" :prodId="liveId" @changeCommentList="changeCommentList"></live-comment-set>
  </div>
</template>

<script>
import LiveDetailCover from "@/components/templates/live/LiveDetailCover.vue";
import shareMasker from "@/components/templates/common/shareMasker.vue";
import showIntegrate from "@/components/templates/common/showIntegrate.vue";
import PackageIndexCom from "@/components/templates/packageIndexCom.vue";
import ComfirmCom from "@/components/templates/common/comfirmCom.vue";
import couponListCom from "@/components/templates/couponListCom.vue";
import { utilJs, wxUtilJs } from "@/utils/common.js";
// import MarketingBuyBtn from "@/components/templates/common/marketingBuyBtn.vue";
import FlashSalesTimeNew from "@/components/templates/flashSalesTimeNew.vue";
import MySmallTabbar from "@/components/templates/common/MySmallTabbar.vue";
import loadingStatusTem from "@/components/templates/common/loadingStatusTem.vue";
import bottomBuyCom from "@/components/templates/common/bottomBuyCom.vue";
import recommendPresent from '@/components/templates/recommendPresent'
import CollagePersonsList from "@/components/templates/collage/collagePersonsList.vue";
import groupGuidance from '@/components/templates/common/groupGuidance.vue'
import PriceBar from '@/components/templates/common/priceBar.vue';
import bargainRules from '@/components/templates/bargain/bargainRules';
import officalAccount from '@/components/templates/common/officalAccount';
// import liveInviteRank from "@/components/templates/live/liveInviteRank.vue";
import bottomCompanyInfo from "@/components/templates/common/bottomCompanyInfo.vue";
import RecommendAward from "@/components/member/recommend/recommendAward.vue";
import collocationBuyCom from '@/components/templates/collocationBuyCom';
import PromoteIncome from '@/components/templates/common/promoteIncome.vue';
import validTimeCom from "@/components/templates/common/validTimeCom.vue";
import { getBindPhoneSetting } from "@/utils/checkUnBindPhone.js";
import enrolCer from "@/components/templates/learnAndachCer/enrolCer.vue";
import relatedList from '@/components/templates/live/relatedList';
import ScreenRecordingSetting from "@/components/templates/common/screenRecordingSetting.vue";
import { mapState } from "vuex";
import DiscountInfo from "@/components/templates/common/discountInfo.vue";
import VipEntry from "@/components/templates/common/vipEntry.vue";
import InviteGroup from "@/components/templates/common/inviteGroup.vue";
import formEntry from "@/components/homePage/form/formEntry.vue"
import liveComment from "@/components/templates/live/liveComment.vue";
import liveCommentSet from "@/components/templates/live/liveCommentSet.vue";
import MoreDevice from "@/components/templates/moreDevice.vue"
import collageGrades from "@/components/templates/collage/collageGrades.vue";
// let liveId = "";
let isClicking = false;
let pathFrom = '-1';
const THEME_RGB_MAP = global.THEME_RGB_MAP;
// let inputScrollTop = 0;
export default {
  name: "LiveDetail",
  components: {
    LiveDetailCover,
    VipEntry,
    InviteGroup,
    DiscountInfo,
    shareMasker,
    showIntegrate,
    PackageIndexCom,
    ComfirmCom,
    couponListCom,
    FlashSalesTimeNew,
    MySmallTabbar,
    loadingStatusTem,
    // MarketingBuyBtn,
    bottomBuyCom,
    recommendPresent,
    CollagePersonsList,
    groupGuidance,
    PriceBar,
    bargainRules,
    officalAccount,
    // liveInviteRank,
    bottomCompanyInfo,
    RecommendAward,
    collocationBuyCom,
    PromoteIncome,
    validTimeCom,
    enrolCer,
    relatedList,
    ScreenRecordingSetting,
    formEntry,
    liveComment,
    liveCommentSet,
    MoreDevice,
    collageGrades
  },
  provide() {
    return {
      goLiveRoom: this.goLiveRoom,
    };
  },
  data() {
    return {
      tabList: [],
      detailTabList:[
         {
          title: "介绍",
          index: 4,
        }
      ],
      detailTabIndex: 4,
      typeBar: 0,
      showShareMoneyTip: true,
      showPassword: false, //显示密码输入
      noticeText: "",
      // inputPwd: "", //密码输入框内容
      companyAuth: JSON.parse(localStorage.getItem("companyAuth")),
      theme: localStorage.getItem("colorName") ? localStorage.getItem("colorName") : "mb5_default",
      statusMap: {
        0: "直播预告",
        1: "正在直播",
        2: "直播回放",
        3: "直播结束"
      },
      liveStatusImg: {
        0: require('../../../assets/i/wap/socail/live_status_ready.png'),
        1: require('../../../assets/i/wap/socail/live_status_living.png'),
        2: require('../../../assets/i/wap/socail/live_status_record.png'),
        3: require('../../../assets/i/wap/socail/live_status_end.png'),
      },
      liveInfo: null,
      teacherList: [],
      signColumns: [],
      isShowShare: false,
      packageList: [],
      lId: '',
      ttId: '', //营期ID
      tpId: '', //环节ID
      tlId: '', //课时ID
      faStatus: 1,
      showCoupon: false,
      couponList: [],
      couponIsPage: false,
      couponPage: 1,
      couponLoading: false,
      showEnterPcTip: false,
      showIntegrate: false, //获取积分提示
      integrateCount: 0,
      vipType: localStorage.getItem("vipType" + localStorage.getItem("userId")),
      vipFitstItem: localStorage.getItem("vipArr1") ? JSON.parse(localStorage.getItem("vipArr1")) : null,
      svipFitstItem: localStorage.getItem("svipArr1") ? JSON.parse(localStorage.getItem("svipArr1")) : null,
      isShowFormlg:localStorage.getItem("showForm") == 1 ? true : false,
      cfg: JSON.parse(localStorage.getItem("cfg")),
      // showGuidePop: false,
      isSalesBegin: false, // 判断限时购是否正在进行
      showAccountQcode: false,
      officalDesc: '关注我们后才可发起砍价哦',
      mpQrcode: '', //二维码
      showTryLook: false,
      bindPhoneSetting: null,
      recType: 0, //推荐类型 1 访问 2 绑定 3 支付
      recRelateId: "",
      themeId: '', //来源圈子任务的主题id
      relateCollocation: [],
      showProcessBar: true,
      isReceivedBuy:0,
      showCombo:false,
      liveId:'',
      showMarketingBuyBtn: false,
      showWeaAppDialog: false, // 显示防录屏弹窗
      recordingSetting: null, // 防止录屏平台设置
      isiOS: false,
      showProtoIncome: false,
      chainInfo: '',
      isChainProd: false,
      isWeChat: utilJs.isWeiXin(),
      isSet:0,
      showMoreDevice: false, // 多设备入口
      ShowFixedBook:true,
      optimal:null,
      isOpenIosGzhPay:true
    };
  },
  beforeRouteEnter(to, from, next) {
    next(vm => {
      pathFrom = from.path;
    });
  },
  beforeRouteUpdate(to, from, next) {
    if (to.path === from.path) {
      window.location.reload(true)
    }
  },
  created() {
    utilJs.appShare(this);
    let reIdArr = window.location.href.split("refereeId=");
    if (reIdArr.length > 1 && reIdArr[1]) {
      let rId = reIdArr[1].split("&").length > 0 ? reIdArr[1].split("&")[0] : reIdArr[1];
      window.localStorage.setItem("refereeId", rId);
    }
  },
  mounted() {},
  computed: {
    ...mapState({
      showBindPhoneModal: (state) => state.oem_store.showBindPhoneModal
    }),
     // 获取按钮专享价名称
    getBuyBtnTitle() {
      // 会根据是否开启ios支付区别文案展示
      let defaultTxt = '立即' + (this.isOpenIosGzhPay ? '购买' : '体验');
      if (this.optimal) {
        const agentName = utilJs.getCustNameMap();
        let btnTxt = '立即购买'
        let chainPrice = this.chainInfo && this.chainInfo.isChainProd ? (this.chainInfo.enableReorderDiscount == 1 && this.chainInfo.isReorder ? this.chainInfo.reorderBonus : this.chainInfo.enableOrderDiscount == 1 ? this.chainInfo.orderBonus : this.liveInfo.price) : this.liveInfo.price;
        let idDiscount = (this.vipType == 3 || this.vipType > 4) && this.liveInfo.commonProdInfo && this.liveInfo.commonProdInfo.agentDiscount < 100
          ? this.liveInfo.commonProdInfo.agentDiscount
          : (this.vipType == 4 && this.liveInfo.svipDiscount < 100)
            ? this.liveInfo.svipDiscount
            : (this.vipType == 2 && this.liveInfo.vipDiscount < 100)
              ? this.liveInfo.vipDiscount
              : 100
        let discountPrice = Number(this.liveInfo.price * idDiscount / 100).toFixed(2);
        if (this.chainInfo && this.chainInfo.isChainProd && Number(chainPrice) <= Number(discountPrice)) {
          let chainName = this.chainInfo.enableReorderDiscount == 1 && this.chainInfo.isReorder ? '复购' : (this.chainInfo.userType == 1 ? '普通用户' : this.chainInfo.userType2Name[this.chainInfo.userType])
          btnTxt = chainPrice != this.liveInfo.price && chainName ? chainName + '专享价' : defaultTxt;
        } else {
          btnTxt = discountPrice * 1 != this.liveInfo.price ? (this.vipType != 1 ? (this.vipType == 2 ? 'VIP专享价' : this.vipType == 4 ? 'SVIP专享价' : agentName[this.vipType] + '专享价') : defaultTxt) : defaultTxt;
        }
        if (this.liveInfo.sales && this.optimal.optimalPriceType == 101) {
          btnTxt = defaultTxt;
        }
        return btnTxt
      }
      return defaultTxt
    },
    //营销原价计算价格
    calculationPrice() {
      let idDiscount = (this.vipType == 3 || this.vipType > 4) && this.liveInfo.commonProdInfo && this.liveInfo.commonProdInfo.agentDiscount < 100
          ? this.liveInfo.commonProdInfo.agentDiscount
          : (this.vipType == 4 && this.liveInfo.svipDiscount < 100)
            ? this.liveInfo.svipDiscount
            : (this.vipType == 2 && this.liveInfo.vipDiscount < 100)
              ? this.liveInfo.vipDiscount
              : 100
      let calculationPrice = Number(this.liveInfo.price * idDiscount / 100).toFixed(2);
      if (this.optimal) {
        // 链动价格
        let chainPrice = this.chainInfo && this.chainInfo.isChainProd ? (this.chainInfo.enableReorderDiscount == 1 && this.chainInfo.isReorder ? this.chainInfo.reorderBonus : this.chainInfo.enableOrderDiscount == 1 ? this.chainInfo.orderBonus : this.liveInfo.price) : this.liveInfo.price;
        // 当链动价格存在且链动价格跟常规身份价格对比时，如果链动小于或者等于身份价格取链动价格
        calculationPrice = this.chainInfo && this.chainInfo.isChainProd && Number(chainPrice) <= Number(calculationPrice) ? chainPrice : calculationPrice;
        if (this.liveInfo.isFriendHelper) {
          calculationPrice = Number(this.optimal.optimalPrice).toFixed(2);
        }
      }
      return calculationPrice;
    },
    //单卖&&没有权限&&价格大于0&&（加入形式&&不是好友助力）&&（优惠券||vip svip折扣信息||积分抵扣）&&（是否参与营销）
    showDiscount() {
      let showdiscount = this.liveInfo.isSaleOnly != 0 &&
      ((this.liveInfo.existPlayLog == 0 && this.liveInfo.payType == 3) || (((this.liveInfo.isBuyed == 1 && this.liveInfo.permissionType == 45) || this.liveInfo.isBuyed == 0) && this.liveInfo.price * 1 > 0)) &&
      Number(this.liveInfo.price) > 0 && !this.liveInfo.isFriendHelper
      return showdiscount
    },
    //是否是营销活动
    isMarketing() {
      let isMarketing = false;
      if (this.liveInfo) {
        if (this.liveInfo.sales) {
          // 限时折扣
          isMarketing = true;
        } else if (this.liveInfo.bargain && ((this.liveInfo.bargain.status == 1 && this.liveInfo.bargain.isPreheat == 1) || this.liveInfo.bargain.status == 2)) {
          // 砍价（未开始(但开启预热) || 进行中)
          isMarketing = true;
        } else if (this.liveInfo.collage && (this.liveInfo.collage.status == 2 || this.liveInfo.collage.status == 1)) {
          // 限时拼团(未开始 || 已开始)
          isMarketing = true;
        } else if (this.liveInfo.isFriendHelper) {
          // 助力好友
          isMarketing = true;
        }
      }
      return isMarketing
    },
    // 判断是否是推荐有礼;
    isRecommendShow() {
      return this.recType == 3 && this.liveInfo.recommend && this.liveInfo.recommend.isExist
    },
    //拼团、限时购展示优惠券
    isFavourable() {
      let isFavourable = this.liveInfo &&
      ((this.liveInfo.bargain &&
      ((this.liveInfo.bargain.status == 1 &&
      this.liveInfo.bargain.isPreheat == 1) || this.liveInfo.bargain.status == 2)) || this.liveInfo.isFriendHelper)
      return isFavourable
    },
    //大转盘是否显示
    showTurn() {
      let showturn = this.liveInfo.joinActivityInfo && this.liveInfo.joinActivityInfo.isJoinActivity == 1
      return showturn;
    },
    // 是否通过门店指定组织用户的权限(开启了指定组织，满足条件，就是通过，没开启标识通过)
    isAuthByStoreOrg() {
      let flag = true;
      if (this.$isStore()) {
        // 门店
        if (this.liveInfo.isDepartments == 1 && this.liveInfo.isUserInDepartment != 1) {
          // 开启指定组织却不在组织里面
          flag = false;
        }
      }
      return flag;
    }
  },
  watch: {},
  methods: {
    cvoverLiveRoom() {
      if ((this.liveInfo.payType == 1 || this.liveInfo.price == 0) && this.liveInfo.isSaleOnly == 1 && this.liveInfo.payType != 3 && this.liveInfo.status == 0 && this.liveInfo.isShowRemind && this.liveInfo.userRole < 2) {
        console.log(33333333333333333333333)
        this.goStartNockLiveRoom()
      } else {
        console.log(11111111111111111111111)
        this.goLiveRoom()
      }
    },
    upDateisShowFixedBook(val) {
      this.liveInfo.isShowRemind = val
      console.log(this.liveInfo.isShowRemind, 'ShowFixedBook')
    },
    updateCommentCount(commentCount) {
      if (commentCount > 0) {
        for (let item in this.tabList) {
          if (this.tabList[item].index == 5) {
            this.tabList[item].title = '评价(' + commentCount + '条)'
          }
        }
      }
    },
    setComment() {
      if (this.liveInfo.isRemove == 1) {
        this.$cjConfirm({
          showCancelButton: false,
          title: '温馨提示',
          message: `暂无权限评论，请联系管理员~`,
        });
        return
      }
      this.$refs.liveCommentSet.openCommentSet()
    },
    changeCommentList() {
      this.$refs.liveComment.inintList()
    },
    judgeCompliance() {
      let postUrl = `${global.apiurl}Certificate/judgeCompliance?prodType=${global.ckFrom.live}&prodId=${this.liveId}`;
      // enableStudyCard	number
      // 是否有设置学习证书1=是；0=否
      // isReceivedStudy	number
      // 是否已经领取了证书：1=是；0=否
      // isComplianceStudy	number
      // 是否达到学习证书发放条件：1=是；0否
      // studyHonorImage	string
      // 学习证书图片（如果领取了会有图片）
      // enableBuyCard	number
      // 是否有设置入学证书1=是；0=否
      // isReceivedBuy	number
      // 是否已经领取了入学证书：1=是；0=否
      // isComplianceBuy	number
      // 是否达到入学证书发放条件：1=是；0否
      // buyHonorImage	string
      // 入学证书证书图片（如果领取了会有图片）
      utilJs.getMethod(postUrl, res => {
        if (res.enableBuyCard == 1 && res.isComplianceBuy == 1 && res.isReceivedBuy == 0) {
          this.isReceivedBuy = res.isReceivedBuy
          let enrolCerLoca = global.ckFrom.live + '-' + this.liveId
          if (JSON.parse(localStorage.getItem("enrolCer")) == enrolCerLoca) {
              return
          } else {
            this.$refs.enrolcerCom.drawNow('', this.liveId, global.ckFrom.live)
          }
        }
      });
    },
    otherClick() {
      this.showMarketingBuyBtn = false;
    },
    popMarketingBuy() {
      this.showMarketingBuyBtn = true;
    },
    closeCombo() {
      this.showCombo = false;
    },
    showPackageList() {
      this.showCombo = true;
    },
    openValidTimeDesc() {
      if (this.$refs.validTime) {
        this.$refs.validTime.openValidTimeDesc(1)
      }
    },
    getProdRelateCollocation() {
      utilJs.getMethod(`${global.apiurl}prodsCollocation/getProdRelateCollocation?prodType=51&prodId=${this.lId}`,
        res => {
          this.relateCollocation = res.data ? res.data.slice(0, 3) : [];
        }
      );
    },
    clickChangeDetailTab(index) {
      this.detailTabIndex = index;
    },
    hideDialog() {
      this.showAccountQcode = false;
    },
    // 判断是否关注公众号
    checkUserIsFollowedMp() {
      let _this = this;
      return new Promise(function (resolve, reject) {
        utilJs.getMethod(`${global.apiurl}bargains/getMpData?bargainId=${_this.liveInfo.bargain.bargainId}`,
          res => {
            resolve(res);
          },
          failRes => {
            reject(failRes)
          }
        )
      })
    },
    goForm() {
      if (this.liveInfo.isOpenFormCollection == 1 && this.liveInfo.isRelForm && localStorage.getItem("showForm") == 1 && (!this.liveInfo.hasFormLog || (this.liveInfo.hasFormLog && this.liveInfo.enableEdit == 2))) {
        let isGoBack = this.liveInfo.isBuyed == 1 || this.liveInfo.payType == 3 || (this.isMarketing && !this.liveInfo.sales) || this.liveInfo.isSaleOnly == 0 ? 1 : 0;
        this.$routerGo(this, "push", { path: '/homePage/form', query: {isGoBack:isGoBack, cId: -1, extId: this.liveInfo.id, ckFrom: global.ckFrom.live, isFromInvite: 0, pId: -1, relType: 9, type: 1, recRelateId: this.recRelateId, recType: this.recType, joinType: 1} }); //type 1表示关联产品
        return;
      }
    },
    // 砍价跳转
    handleClickBargainDetail(bargainId) {
      if (this.liveInfo.bargain.status == 1) {
        this.$showCjToast({
          text: '活动未开始，暂不能砍价！',
          type: 'warn'
        });
        return;
      }
      this.checkUserIsFollowedMp().then(res => {
        if (res.threshold == 2 && res.isFollowedMp == 0) {
          this.mpQrcode = res.mpQrcode;
          this.showAccountQcode = true;
          return;
        }
        if (this.bindPhoneSetting && this.bindPhoneSetting.buyBind) {
          if (utilJs.goBindMobile()) return;
        }
        // 有关联表单，则跳到报名表单处
        if (this.liveInfo.isOpenFormCollection == 1 && this.liveInfo.collectPage == 1 && this.liveInfo.isRelForm && localStorage.getItem("showForm") == 1 && !this.liveInfo.hasFormLog) {
          this.$routerGo(this, "push", { path: '/homePage/form', query: {cId: -1, extId: this.liveInfo.id, ckFrom: global.ckFrom.live, isFromInvite: 0, pId: -1, relType: 9, type: 1, recRelateId: this.recRelateId, recType: this.recType, joinType: 1} }); //type 1表示关联产品
          return;
        }
        if (this.liveInfo.bargain.status == 2) {
          this.$routerGo(this, "push", {
            path: "/homePage/bargain/bargainDetail",
            query: {
              bargainId: bargainId
            }
          });
        }
      })
    },
    handleShowGuidePop() {
      // 显示入群引导
      this.$refs.guidance.isShowPop();
    },
    gcd(cinfo) {
      console.log(111111111111)
      if (((this.liveInfo.isBuyed == 1 && this.liveInfo.permissionType == 45) || this.liveInfo.isBuyed == 0) && this.liveInfo.isUserGroup == 1 && this.liveInfo.isInUserGroups != 1) {
        this.$cjConfirm({
            showCancelButton: false,
            message: this.liveInfo.payType == 2 ? '仅指定用户可购买' : '仅指定用户可观看',
        });
        return;
      }
      if (((this.liveInfo.isBuyed == 1 && this.liveInfo.permissionType == 45) || this.liveInfo.isBuyed == 0) && !this.isAuthByStoreOrg) {
        this.$cjConfirm({
          showCancelButton: false,
          message: this.liveInfo.payType == 2 ? '仅指定组织成员可购买' : '仅指定组织成员可观看',
        });
        return;
      }
      this.goCollageDetail(cinfo.groupId, cinfo.collageId);
    },
    //打卡配套关联跳转
    goSignColumns(id) {
      this.$routerGo(this, "push", {
        path: "/homePage/clockIn/clockInDetail",
        query: {clockInId: id}
      })
    },
    //拼团详情
    goCollageDetail(groupId, collageId) {
      if (((this.liveInfo.isBuyed == 1 && this.liveInfo.permissionType == 45) || this.liveInfo.isBuyed == 0) && this.liveInfo.isUserGroup == 1 && this.liveInfo.isInUserGroups != 1) {
        this.$cjConfirm({
            showCancelButton: false,
            message: this.liveInfo.payType == 2 ? '仅指定用户可购买' : '仅指定用户可观看',
        });
        return;
      }
      if (((this.liveInfo.isBuyed == 1 && this.liveInfo.permissionType == 45) || this.liveInfo.isBuyed == 0) && !this.isAuthByStoreOrg) {
        this.$cjConfirm({
          showCancelButton: false,
          message: this.liveInfo.payType == 2 ? '仅指定组织成员可购买' : '仅指定组织成员可观看',
        });
        return;
      }
      if (this.liveInfo.collage.userType != -1 && this.liveInfo.collage.groupId != groupId) {
        this.$showCjToast({
          text: '您已在拼团中，不需要再去拼单啦！',
          type: 'warn'
        });
      } else {
        if (this.liveInfo.collage.status == 1) {
          this.$showCjToast({
            text: '活动未开始，暂不能拼团！',
            type: 'warn'
          });
        } else {
          let hfs = this.liveInfo.isOpenFormCollection == 1 && this.liveInfo.isRelForm && !this.liveInfo.hasFormLog;
          let pathQuery = {
            'groupId': groupId,
            'collageId': collageId,
            isRelForm: hfs,
            extId: this.liveId,
            relType: 9,
            recRelateId: this.recRelateId,
            recType: this.recType
          };
          if (this.goodsRoomId) {
            pathQuery.goodsRoomId = this.goodsRoomId;
          }
          this.$routerGo(this, "push", {
            path: "/homePage/collage/collageDetail",
            query: pathQuery
          });
        }
      }
    },
    //拼团详情
    goBuy(groupId, collageId) {
      if (((this.liveInfo.isBuyed == 1 && this.liveInfo.permissionType == 45) || this.liveInfo.isBuyed == 0) && this.liveInfo.isUserGroup == 1 && this.liveInfo.isInUserGroups != 1) {
        this.$cjConfirm({
            showCancelButton: false,
            message: this.liveInfo.payType == 2 ? '仅指定用户可购买' : '仅指定用户可观看',
        });
        return;
      }
      if (((this.liveInfo.isBuyed == 1 && this.liveInfo.permissionType == 45) || this.liveInfo.isBuyed == 0) && !this.isAuthByStoreOrg) {
        this.$cjConfirm({
          showCancelButton: false,
          message: this.liveInfo.payType == 2 ? '仅指定组织成员可购买' : '仅指定组织成员可观看',
        });
        return;
      }
      if (this.liveInfo.collage.userType != -1 && this.liveInfo.collage.groupId != groupId) {
        this.$showCjToast({
          text: '您已在拼团中，不需要再去拼单啦！',
          type: 'warn'
        });
      } else {
        if (this.liveInfo.collage.status == 1) {
          this.$showCjToast({
            text: '活动未开始，暂不能拼团！',
            type: 'warn'
          });
        } else {
         //要加判断是否选择阶梯
          if (this.liveInfo.collage && this.liveInfo.collage.collageGroupType == 1 ) {
            this.$refs.collageGrades.goChoseBuy()
          } else {
            this.$refs.collageGrades.showBuy()
            // this.isShowBuy = true; //选择阶梯
          }
        }
      }
    },
    //分享回调领取积分(只能领取一次) type: 1分享 2观看直播
    shareGetIntegration() {
      if ((this.companyAuth.enableShareLiveFlowPoint != 1 && this.companyAuth.pointModel == 1) || (this.companyAuth.enableShareLiveFlow != 1 && this.companyAuth.pointModel == 2)) {
        return;
      }
      let $this = this;
      //积分来源 1. 分享视频，2：观看视频，3：分享音频，4：观看音频，14：分享文章 51：分享知识套餐 52：分享专刊 53：分享直播 54：观看直播 55：绑定手机 56：分享课程（每日） 57：分享知识套餐（每日） 58：分享专栏 59：分享直播 60：观看课程（次数）61：观看直播（次数）62：阅读图文时长 63：视听学习时长 64：直播学习时长
      let data = {
        cId: -1,
        extId: this.lId,
        pointFrom: this.companyAuth.pointModel == 1 ? 53 : 59,
        duration: -1
      };
      utilJs.postMethod(`${global.apiurl}common/getPoints`, data, function (
        res
      ) {
        let integrateCount = 0;
        integrateCount = res.points;
        if (integrateCount > 0) {
          $this.integrateCount = integrateCount;
          $this.showIntegrate = true;
        }
      });
    },
    copyText() {
      utilJs.copyText(this.liveInfo.pcWebLiveUrl);
    },
    clickDesc(e) {
      if (e.target.tagName == 'IMG' && e.target.src) {
        wxUtilJs.previewImage({
          current: e.target.src, // 当前显示图片的http链接
          urls: [e.target.src] // 需要预览的图片http链接列表
        });
      }
    },
    closeModal() {
      this.showCoupon = false;
    },
    //获取可以领取的优惠券
    getCouponList: function () {
      if (!this.couponLoading) {
        this.couponLoading = true;
        let $this = this;
        utilJs.getMethod(global.apiurl + 'redeemCodes/getCouponsByRedeemType?courseId=' + this.lId + '&redeemType=95&limit=10&page=' + this.couponPage, function (res) {
          $this.couponLoading = false;
          $this.couponList = $this.couponList.concat(res.data);
          $this.couponPage = res.next_page_url ? ($this.couponPage + 1) : $this.couponPage;
          $this.couponIsPage = res.next_page_url ? true : false;
        },
          failRes => {
            $this.couponLoading = false;
          }
        );
      }
    },
     //改变typeBar
    changeType: function (type) {
      //this.typeBar = typeBar;
      if (this.typeBar != type) {
        this.typeBar = type;
      }
      if (this.typeBar == 5) {
        this.$refs.liveComment.inintList()
      }
      return false;
    },
    //活动海报
    invitePoster: function () {
      if (this.bindPhoneSetting && this.bindPhoneSetting.shareBind) {
        if (utilJs.goBindMobile()) return;
      }
      let ckFrom = global.ckFrom.live;//this.ckFrom;
      let type = this.liveInfo.collage ? 3 : this.liveInfo.sales ? 2 : this.liveInfo.bargain ? 5 : 4;
      let cId = this.liveInfo.isFriendHelper ? this.liveInfo.faId : this.liveInfo.collage ? this.liveInfo.collage.collageId : this.liveInfo.bargain ? this.liveInfo.bargain.bargainId : this.liveInfo.sales.pId;
      let proId = this.liveId;
      this.$routerGo(this, "push", { path: '/homePage/spread/spreadPoster', query: { cId: cId, type: type, ckFrom: ckFrom, proId: proId } });
    },
    //助力详情
    goHelpDetail: function () {
      if (this.bindPhoneSetting && this.bindPhoneSetting.helpBind && utilJs.goBindMobile()) {
       return
      }
      if (this.faStatus == 1) {
        this.$showCjToast({
          text: '活动未开始，暂不能助力领取！',
          type: 'warn'
        });
      } else {
        this.$routerGo(this, "push", {
          path: "/homePage/task/task",
          query: { 'faId': this.liveInfo.faId, 'refereeId': localStorage.getItem("userId") }
        });
      }
    },
    //友情灌溉倒计时
    friendTimeFn: function () {
      let stime = this.liveInfo ? utilJs.getTimeByDate(this.liveInfo.faStartAt) : 0;
      let etime = this.liveInfo ? utilJs.getTimeByDate(this.liveInfo.faEndAt) : 0;
      let nowTime = (new Date()).getTime();
      //faStatus 1未开始,2进行中,3已结束,4已停止
      let time = '';
      if (stime > nowTime) {
        this.faStatus = 1;
        time = this.liveInfo.faStartAt;
      } else if (etime > nowTime) {
        this.faStatus = 2;
        time = this.liveInfo.faEndAt;
      }
      return time;
    },
    //友情灌溉倒计时结束修改状态
    friendFinishFn: function () {
      if (this.faStatus == 1) {
        this.faStatus = 2;
        this.friendTimeFn();
      } else {
        this.liveInfo.isFriendHelper = false;
        this.faStatus = 3;
      }
    },
    // // 限时购倒计时
    falshSalesTime(status) {
      if (this.liveInfo.sales) {
        this.liveInfo.sales.sales.status = status
      } else if (this.liveInfo.collage) {
        this.liveInfo.collage.status = status
      } else if (this.liveInfo.isFriendHelper) {
        this.faStatus = status;
      } else if (this.liveInfo.bargain) {
        this.liveInfo.bargain.status = status
      }
    },
    // // 限时购倒计时结束
    finishFlashSales(status) {
      if (this.liveInfo.sales) {
        this.liveInfo.sales.sales.status = status
      } else if (this.liveInfo.collage) {
        this.liveInfo.collage.status = status
      } else if (this.liveInfo.isFriendHelper) {
        this.faStatus = status;
      } else if (this.liveInfo.bargain) {
        this.getLiveInfo();
      }
      // 活动已结束，清空所有营销活动信息及状态
      if (status == -1) {
        this.liveInfo.sales = null;
        this.liveInfo.collage = null;
        this.liveInfo.isFriendHelper = false;
      }
    },
    changePsw() {
      this.noticeText = "";
    },
    //显示密码输入框
    clickEnterPwd() {
      // if (this.liveInfo.liveType == 4 || this.liveInfo.liveType == 3) {
      //   this.$showCjToast({
      //     text: '语音直播，PPT直播正在维护，预计2月29号上线 ，如有需要，先用视频直播',
      //     type: 'warn'
      //   });
      //   return;
      // }
      if (this.bindPhoneSetting && this.bindPhoneSetting.passwordBind) {
        if (utilJs.goBindMobile()) return;
      }
      // 有关联表单，则跳到报名表单处
      if (this.liveInfo.isOpenFormCollection == 1 && this.liveInfo.collectPage != 3 && this.liveInfo.userRole < 2 && this.liveInfo.isRelForm && localStorage.getItem("showForm") == 1 && !this.liveInfo.hasFormLog) {
        this.$routerGo(this, "push", { path: '/homePage/form', query: {cId: -1, extId: this.liveInfo.id, ckFrom: global.ckFrom.live, isFromInvite: 0, pId: -1, relType: 9, type: 1, recRelateId: this.recRelateId, recType: this.recType, joinType: 1} }); //type 1表示关联产品
        return;
      }
      this.noticeText = '';
      this.showPassword = true;
    },
    //提交密码
    submitPassword(inputPwd) {
      if (!inputPwd.trim()) {
        this.noticeText = "*密码错误";
        return;
      }
      if (isClicking) {
        return;
      }
      isClicking = true;
      utilJs.getMethod(`${global.apiurl}liveFlow/checkPassword/${this.liveInfo.id}/${encodeURIComponent(inputPwd)}`,
        res => {
          isClicking = false;
          if (res == 0) {
            this.noticeText = "*密码错误";
          } else {
            this.showPassword = false;
            if (this.$isWxApp()) { // 小程序输入密码成功后需要手动更新权限，否则直播间返回是没有刷新页面的
              this.liveInfo.isBuyed = true
            }
            if (!this.$refs.guidance.showGuidePop) {
              this.goLiveRoom();
            }
          }
        },
        failRes => {
          isClicking = false;
        }
      );
    },
    //邀请好友
    spreadInvite() {
      if (this.bindPhoneSetting && this.bindPhoneSetting.shareBind) {
        if (utilJs.goBindMobile()) return;
      }
      if (this.liveInfo.isInvitionCard == 0) {
        this.isShowShare = true;
        return;
      }
      let extId = this.$route.query.liveId;
      this.$routerGo(this, "push", {
        path: "/homePage/spread/spreadCustom",
        query: {
          ckFrom: global.ckFrom.live,
          cId: 0,
          extId: extId
        }
      })
    },
    //跳转至大转盘
    goTOturn() {
      let $this = this
      $this.$routerGo($this, "push", {
        path: "/homePage/marketing/turntable",
        query: {
          taId: $this.liveInfo.joinActivityInfo.activityData.id
        }
      });
    },
    //获取直播信息
    getLiveInfo(isFirst = 0) {
      let $this = this
      let postUrl = global.apiurl + "liveFlow/getMobileLiveActivityById/" + this.liveId + '?isSkeleton=1&time=' + new Date().getTime();
      if (this.themeId) {
        postUrl = postUrl + `&themeId=${this.themeId}`
      }
      utilJs.getMethod(postUrl,
        res => {
          //防止跳出页面后还继续走
          if (this.$route.fullPath.includes('bindMobile')) {
            return;
          }
          // 删除或无购买被下架
          if (res.data[0].isDelete == 1 || (res.data[0].shelfStatus != 1 && (res.data[0].isBuyed != 1 || (res.data[0].isBuyed == 1 && res.data[0].permissionType == 45)) && res.data[0].price * 1 > 0) || (res.data[0].shelfStatus != 1 && res.data[0].price * 1 == 0)) {
            this.$routerGo(this, "replace", {
              path: "/error/emptyPage",
              query: {
                from: "",
                info: "该直播已下架，请联系管理员！"
              }
            });
            return;
          }
          let info = res.data[0];
          this.optimal = info.optimal || null;
          //是否可试看 =》非停售 && 有试看时间 && 已试看时间< 可试看时长 && 未购买 && 价格大于0 && 直播结束有回放&&非未开始
          let showTryLook = info.isSaleOut == 1 && info.watchTime && info.alreadyWatchTime * 1 < info.watchTime &&
            ((info.isBuyed == 1 && info.permissionType == 45) || info.isBuyed == 0) && info.payType == 2 && info.status < 3 ;
          //是否从直播间进入该页面
          let showMoreDevice = (info.isBuyed || (info.isBuyed == 1 && info.permissionType != 45)) && this.typeBar == 0 && !showTryLook && info.status < 3;
          let isFromLiveRoom = pathFrom.includes('liveRoom') || pathFrom.includes('liveVerticalRoom') || pathFrom.includes('liveVHTryRoom') || (sessionStorage.getItem("livePathFrom") == "room");
          //不是从直播间进来的 && 是试看，直接跳转
          let recRelateId = this.recRelateId; //推荐人ID
          let recType = this.recType; //推荐类型 1 访问 2 绑定 3 支付
          // let bindPhone = this.$route.query.bindPhone; //完成推荐绑定手机号
          //是否推荐有礼绑定手机号
          let isRecommend = recRelateId && (recType == 2 || recType == 1);
          //是否显示大转盘支付有礼活动
          let isShowTurntable = info.joinActivityInfo && info.joinActivityInfo.isShowDialog == 1;
          //是否被移除群聊
          let isRemove = info.isRemove == 1;
          //进入直播间是否需要绑定手机号
          let isNeedBindPhone = this.bindPhoneSetting && this.bindPhoneSetting.getBind;
          //是否关联表单
          let isGoForm = info.isOpenFormCollection == 1 && info.collectPage != 3 && info.userRole < 2 && info.isRelForm && localStorage.getItem("showForm") == 1 && !info.hasFormLog;
          //(付费 && 已购买) || (免费 && 单卖) || (关联售卖 && 已购买) || (加密 && 已进入)
          // let hasPermission = (info.isBuyed == 1 && info.payType == 2) || info.isBuyed == 3 || (info.payType == 1 && info.isSaleOnly == 1) || (info.isSaleOnly == 0 && info.isBuyed == 1) || (info.payType == 3 && info.existPlayLog == 1);
          let hasPermission = info.isBuyed >= 1;
          //直播是否开始 && 直播中、回放
          let isStartLive = info.status >= 0 && info.status < 3;
          let companyIdArr = ['36oewz', 'g9bk3e', '5qgedg', 'lj7l']; //这三个公司就算有直播视频简介也自动跳直播间
          let curCompanyId = localStorage.getItem('companyId');
          let isOpenNoRecord = this.checkIsOpenNoRecord(info);
          //没有开启了禁止录屏 && 不是从直播间进入的 && 无大转盘活动 && 未被移除群聊 && 不需要绑定手机号 && 不需要跳表单 && 直播已开始
          if (!isOpenNoRecord && !this.showBindPhoneModal && !isRecommend && !isFromLiveRoom && !isShowTurntable && !isRemove && !isNeedBindPhone && !isGoForm
          && isStartLive && hasPermission && info.isJumpToViewPage == 1 &&
          (!info.videoIntroUrl || info.status == 1 || (companyIdArr.includes(curCompanyId) && info.videoIntroUrl))) {
            this.$loading.show({
              text: "正在进入直播间..."
            });
            this.enterRoomNow(info).catch(() => {
              this.$routerGo(this, "replace", { path: '/' })
            });
            return;
          }
          if (sessionStorage.getItem("livePathFrom")) {
            sessionStorage.removeItem("livePathFrom");
          }
          this.companyAuth = JSON.parse(localStorage.getItem("companyAuth"));
          this.liveInfo = info;
          let nowTmp = new Date().getTime();
          let liveTimeTmp = new Date(this.liveInfo.startAt.replace(/-/g, '/')).getTime();
          let subTimeTmp = liveTimeTmp - nowTmp;
          if (subTimeTmp < 5 * 60 * 1000) {
            this.liveInfo.isShowRemind = false;
          }
          this.showTryLook = showTryLook;
          this.showMoreDevice = showMoreDevice;
          this.$nextTick(() => {
            this.initDetailCover();
          })
          if (this.liveInfo.descPath && this.liveInfo.descPath.length > 5) {
            utilJs.getPageHtml(this.liveInfo.descPath, sres => {
              this.liveInfo.intro = sres;
            });
          }
          if (isShowTurntable) {
            $this.$cjConfirm({
              title: '', //
              titleCenter: true, //标题是否居中
              message: '恭喜！您获得了大转盘抽奖机会！',
              messageCenter: true, //内容是否居中
              showMasker: true, //是否显示透明背景
              clickCloseModal: false, //是否点击透明背景关闭弹窗
              showCancelButton: true, //是否显示取消按钮
              cancelButtonText: '稍后再说', //取消按钮文本
              confirmButtonText: '立刻前往', //确认按钮文本
              onConfirm() {
                $this.$routerGo($this, "push", {
                  path: "/homePage/marketing/turntable",
                  query: {
                    taId: $this.liveInfo.joinActivityInfo.activityData.id
                  }
                });
              }
            })
          }
          this.teacherList = res.data.teachers;
          this.signColumns = res.data.signColumns;
          if (this.teacherList.length > 0 && this.liveInfo.isShowLecture == 1) {
            this.tabList = [{
              title: '详情',
              index: 0,
            }, {
              title: '讲师',
              index: 1,
            }]
          } else {
            this.tabList = [{
              title: '详情',
              index: 0,
            }]
          }
          if ((this.signColumns.length > 0 && this.liveInfo.isBuyed == 1) || (this.signColumns.length > 0 && this.liveInfo.existPlayLog == 1 && this.liveInfo.payType == 3 && this.liveInfo.isBuyed == 0)) {
            this.tabList.push({
              title: '搭配学习',
              index: 3,
            })
          }
          // 多门店隐藏相关的入口
          if (!this.$isStore()) {
            this.tabList.push({
              title: '相关',
              index: 4,
            })
          }
          if (this.liveInfo.isOpenStudentComment == 1) {
            if (this.liveInfo.commentCount > 0) {
              this.tabList.push({
                title: '评价(' + this.liveInfo.commentCount + '条)',
                index: 5,
              })
            } else {
              this.tabList.push({
                title: '评价',
                index: 5,
              })
            }
          }
          if (this.liveInfo.isBuyed != 1) {
            this.getProdRelateCollocation();
          }
          setTimeout(() => {
            this.showProtoIncome = true;
          }, 100);
          this.wechatShare();
          //直播状态为回放，并且回放地址为空，则需要调用接口生成回放地址
          if (res.data[0].liveType == 1 && res.data[0].returnUrlStatus == 1 && res.data[0].status == 2) {
            this.initLiveRePlay();
          }
          // 拼团
          if (res.data[0].collage != null && this.companyAuth.enableCollage == 1) {
            let nt = (new Date()).getTime();
            let st = utilJs.getTimeByDate(res.data[0].collage.startTime);
            let et = utilJs.getTimeByDate(res.data[0].collage.endTime);
            if (nt >= st && nt < et && res.data[0].collage.status < 3) {
              // this.ckFrom = res.columnId == 0 ? global.ckFrom.collageCourse : global.ckFrom.collageColumn;
              this.liveInfo.collage.status = 2;
            } else if (nt < st && res.data[0].collage.status == 1) {
              // $this.ckFrom = res.columnId == 0 ? global.ckFrom.collageCourse : global.ckFrom.collageColumn;
              this.liveInfo.collage.status = 1;
            } else if (nt >= et && res.collage.status == 2) {
              this.liveInfo.collage.status = 3;
              this.liveInfo.collage = null;
              // $this.ckFrom = res.columnId == 0 ? global.ckFrom.course : global.ckFrom.column;
            } else {
              this.liveInfo.collage = null;
              // $this.ckFrom = res.columnId == 0 ? global.ckFrom.course : global.ckFrom.column;
            }
          } else if (res.data[0].sales != null && res.data[0].sales.status && (res.data[0].sales.limit == 0 || res.data[0].sales.balance > 0) && this.companyAuth.enableFlashSalesModule == 1) { //限时购
            let nt = (new Date()).getTime();
            let st = utilJs.getTimeByDate(res.data[0].sales.sales.startTime);
            let et = utilJs.getTimeByDate(res.data[0].sales.sales.endTime);
            if (nt >= st && nt < et && res.data[0].sales.sales.status > -1) {
              res.data[0].sales.sales.status = 2;
            } else if (nt < st && res.data[0].sales.sales.status == 1) {
              res.data[0].sales.sales.status = 1;
              // this.liveInfo.sales = null;
            } else if (nt >= et && res.data[0].sales.sales.status == 2) {
              res.data[0].sales.sales.status = -1;
              this.liveInfo.sales = null;
            } else {
              this.liveInfo.sales = null;
            }
          } else if (this.liveInfo.isFriendHelper) { //友情灌溉
            let stime = this.liveInfo ? utilJs.getTimeByDate(this.liveInfo.faStartAt) : 0;
            let etime = this.liveInfo ? utilJs.getTimeByDate(this.liveInfo.faEndAt) : 0;
            let nowTime = (new Date()).getTime();
            //faStatus 1未开始,2进行中,3已结束,4已停止
            if (stime > nowTime) {
              this.faStatus = 1;
            } else if (etime > nowTime) {
              this.faStatus = 2;
            }
          } else {
            this.liveInfo.sales = null;
            this.liveInfo.collage = null;
            // this.ckFrom = global.ckFrom.package;
          }
          if (res.data[0].sales && res.data[0].sales.sales) {
            this.isSalesBegin = (res.data[0].sales.sales.startTime).replace(/\s+|[-]|[:]/g, "") <= (utilJs.getNowTime()).replace(/\s+|[-]|[:]/g, "") ? true : false;
          }
          if (isFirst == 1) {
            this.wechatShare();
            this.getRelatePackage();
            this.getCouponList();
            this.isRecommendPage();
          }
          this.judgeCompliance()
          if (this.recordingSetting && this.recordingSetting.screenRecording == 1 && this.recordingSetting.ckApp == 0 && (utilJs.isAndroidApp() || utilJs.isIOSAppALL()) && ((this.recordingSetting.fitCourses == 1) || (this.liveInfo.isScreenRecordingCourse))) {
            utilJs.sendDataToAppWebview('banScreenRecording');
          }
          if (sessionStorage.getItem('liveGoBuy') == 1) {
            this.clickBuy()
            sessionStorage.removeItem('liveGoBuy');
          }
          // 获取价格信息
          // utilJs.getPriceInfo({
          //   initPrice: this.liveInfo.price,
          //   optimal:this.optimal,
          //   chainInfo: this.chainInfo,
          //   collage:this.liveInfo.collage,
          //   bargain:this.liveInfo.bargain,
          //   comonProdInfo: this.liveInfo.commonProdInfo,
          //   vipDiscountType:this.liveInfo.vipDiscountType,
          //   vipDiscount:this.liveInfo.vipDiscount,
          //   vipDiscountPrice:this.liveInfo.vipDiscountPrice,
          //   svipDiscount:this.liveInfo.svipDiscount,
          //   svipDiscountPrice:this.liveInfo.svipDiscountPrice
          // });
        }, () => {
         this.$routerGo(this, "replace", {
            path: "/",
          });
       });
    },
    initDetailCover() {
      let info = {
        prodId: this.liveId, //直播id
        cover: this.liveInfo.liveCover,
        payType: this.liveInfo.payType,
        isShowRemind: this.liveInfo.isShowRemind, //是否开启预约
        liveStatus: this.liveInfo.status,
        videoIntroUrl: this.liveInfo.videoIntroUrl || '', //视频简介
        videoIntroM3u8: this.liveInfo.videoIntroM3u8 || '',
        startAt: this.liveInfo.startAt || '', //直播开始时间
      }
      this.$refs.liveDetailCover.public_initDetail(info);
    },
    //有权限自动跳到直播间逻辑处理
    async enterRoomNow(info) {
      if (info.notInSocialRoom == 1) {
        try {
          await this.addSocialRoom(info);
        } catch (e) {
          return Promise.reject();
        }
      }
      if (info.existPlayLog2 == 0) {
        await this.addLivePlayLog()
      }
      // 小程序环境要直接做替换路由，否则跳转中间页在返回会一直存在 正在进入直播间 的loading
      if (this.$isWxApp()) {
        info.replace = true
      }
      this.routerGoRoom(info);
    },
    //直播回放没有地址的话,调用生成回放地址
    initLiveRePlay() {
      utilJs.getMethod(`${global.apiurl}liveFlow/getViewRecent/${this.liveId}`, res => { })
    },
    handleClickDetail() {
      let url = this.liveInfo.userGroupUrl
      if (url == '') {
        return
      }
      if (!url.includes("http") && !url.includes("https")) {
        url = "http://" + url;
      }
      utilJs.locationHref(url, this);
    },
    //点击立即购买
    clickBuy() {
      // if (this.liveInfo.liveType == 4 || this.liveInfo.liveType == 3) {
      //   this.$showCjToast({
      //     text: '语音直播，PPT直播正在维护，预计2月29号上线 ，如有需要，先用视频直播',
      //     type: 'warn'
      //   });
      //   return;
      // }
      if (this.liveInfo.isRemove == 1) {
        this.$cjConfirm({
            showCancelButton: false,
            message: `您暂无权限进入！请联系管理员！`,
        });
        return;
      }
      let pathQuery = {};
      if (this.bindPhoneSetting && this.bindPhoneSetting.buyBind) {
        if (this.goodsRoomId) {
          pathQuery.goodsRoomId = this.goodsRoomId;
        }
        if (utilJs.goBindMobile(pathQuery)) return;
      }
      let isInSales = this.liveInfo.sales && this.liveInfo.sales.sales.status == 2 && this.optimal && this.optimal.optimalPriceType == 101;
      let pId = isInSales ? this.liveInfo.sales.pId : null;
      let ckFrom = global.ckFrom.live;
      // 判断非推荐有礼下单支付得时候，如果当前是推荐有礼的不带参数，走普通下单流程
      if (this.recType != 3 && this.liveInfo.recommend != null && this.liveInfo.recommend.isExist == 0) {
        this.recRelateId = '';
      }
      pathQuery = {
        extId: this.liveInfo.id,
        ckFrom: ckFrom,
        isFromInvite: 0,
        cId: -1,
        recType: this.recType,
        recRelateId: this.recRelateId
      }
      if (isInSales) {
        ckFrom = global.ckFrom.flashSalesLive;
        pathQuery.ckFrom = ckFrom;
        pathQuery.pId = pId;
      }
      if (this.goodsRoomId) {
        pathQuery.goodsRoomId = this.goodsRoomId;
      }
      // 有关联表单，则跳到报名表单处
      if (this.liveInfo.isOpenFormCollection == 1 && this.liveInfo.collectPage == 1 && this.liveInfo.collectPage != 3 && this.liveInfo.isRelForm == true && this.liveInfo.hasFormLog != true && localStorage.getItem("showForm") == 1) {
        let formQuery = {
          cId: -1,
          extId: this.liveInfo.id,
          ckFrom: ckFrom,
          isFromInvite: 0,
          pId: pId,
          relType: 9,
          type: 1,
          recRelateId: this.recRelateId,
          recType: this.recType
        }
        if (this.goodsRoomId) {
          formQuery.goodsRoomId = this.goodsRoomId;
        }
        this.$routerGo(this, "push", { path: '/homePage/form', query: formQuery }); //type 1表示关联产品
        return;
      }

      this.$routerGo(this, "push", {
        path: "/homePage/course/coursePay",
        query: pathQuery
      });
    },
    //判断是否开启禁止录屏
    checkIsOpenNoRecord(info = this.liveInfo) {
      //开启防录屏 && ((h5禁止观看 && 非小程序与 && 非app) || (小程序禁止观看 && 是小程序)) && (全部课程禁止观看 || 指定课程禁止观看)
      let isOpen = this.recordingSetting && this.recordingSetting.screenRecording == 1 && ((this.recordingSetting.ckH5Shop == 0 && !this.$isWxApp() && !utilJs.isAndroidApp() && !utilJs.isIOSAppALL()) || (this.recordingSetting.ckShopMiniProgram == 0 && this.$isWxApp())) && ((this.recordingSetting && this.recordingSetting.fitCourses == 1) || info.isScreenRecordingCourse);
      return isOpen;
    },
    //进入直播间
    async clickEnterRoom() {
      if (this.liveInfo.isRemove == 1) {
        this.$cjConfirm({
            showCancelButton: false,
            message: `您暂无权限进入！请联系管理员！`,
        });
        return;
      }
      //讲师身份不进入表单
      if (this.liveInfo.isOpenFormCollection == 1 && this.liveInfo.collectPage != 3 && this.liveInfo.userRole < 2 && this.liveInfo.isRelForm == true && localStorage.getItem("showForm") == 1 && !this.liveInfo.hasFormLog) {
        this.$routerGo(this, "push", { path: '/homePage/form', query: {cId: -1, extId: this.liveInfo.id, ckFrom: global.ckFrom.live, isFromInvite: 0, pId: -1, relType: 9, type: 1, recRelateId: this.recRelateId, recType: this.recType, joinType: 1} }); //type 1表示关联产品 jointype1表示密码加入
        return;
      }
      // 添加防录屏判断
      if (this.checkIsOpenNoRecord()) {
        this.showWeaAppDialog = true;
        return
      }
      //已经有进入过，直接进入直播间
      if (this.liveInfo.existPlayLog == 1) {
        if (this.liveInfo.notInSocialRoom == 1) {
          await this.addUserToSocailRoom();
        }
      } else {
        if (isClicking) {
          return;
        }
        isClicking = true;
        await this.addUserToSocailRoom();
      }
      if (this.showTryLook && this.liveInfo.status != 0 && this.liveInfo.isBuyed == 0) {
        await this.setTryWatchUser()
      }
      if (this.liveInfo.existPlayLog2 == 0) {
        await this.addLivePlayLog()
      }
      this.routerGoRoom();
    },
    routerGoRoom(info) {
      let roomInfo = info || this.liveInfo;
      let refId = this.$route.query.refereeId || '';
      let goPath = roomInfo.playType == 2 ? 'liveVerticalRoom' : 'liveRoom';
      let routerPath = `/homePage/live/${goPath}?liveId=${this.liveId}&SocialRoomId=${roomInfo.jGRoomId}&liveType=${roomInfo.liveType}&ttId=${this.ttId}&tpId=${this.tpId}&tlId=${this.tlId}&ckFrom=${this.ckFrom}`;
      if (refId) {
        routerPath = `${routerPath}&refereeId=${refId}`;
      }
      let zhytUrl = this.$route.query.zhytUrl || '';
      if (zhytUrl) {
        routerPath = `${routerPath}&zhytUrl=${zhytUrl}`;
      }
      sessionStorage.setItem("livePathFrom", "room");
      if (this.$route.query.activityFrom == 1) {
        //扫码领奖
        routerPath = `${routerPath}&activityType=${this.$route.query.activityType}&activityId=${this.$route.query.activityId}&activityFrom=${this.$route.query.activityFrom}`;
      }
      this.$routerGo(this, info && info.replace ? "replace" : "push", { path: routerPath });
    },
    setTryWatchUser() {
      return new Promise((resolve, reject) => {
        let postData = {
         "liveId": this.liveId,
         "moduleType":1
        };
        utilJs.postMethod(global.apiurl + "liveFlow/setTryWatchUser/" + this.liveId, postData, () => {
          resolve();
        }, () => {
          reject();
        });
      })
    },
    addUserToSocailRoom() {
      return new Promise((resolve, reject) => {
        let postData = {
         "isCombos": this.liveInfo.isBuyed == 1 && this.liveInfo.permissionType == 12 ? 61 : 0,
          "socialRoomId": this.liveInfo.jGRoomId,
          "refereeId": localStorage.getItem("refereeId")
        };
        utilJs.postMethod(global.apiurl + "social/addSocialRoom", postData, () => {
          isClicking = false;
          resolve();
        }, () => {
          isClicking = false;
          reject();
        });
      })
    },
    addSocialRoom(info) {
      let roomInfo = info || this.liveInfo;
      return new Promise((resolve, reject) => {
        let postData = {
        "isCombos": roomInfo.isBuyed == 1 && roomInfo.permissionType == 12 ? 61 : 0,
        "socialRoomId": roomInfo.jGRoomId,
        "refereeId": localStorage.getItem("refereeId")
        };
        utilJs.postMethod(global.apiurl + "social/addSocialRoom", postData, () => {
          resolve();
        }, () => {
          reject();
        });
      })
    },
    //加密引导添加直播记录
    addLivePlayLogByGuide() {
      utilJs.getMethod(global.apiurl + "liveFlow/addLivePlayLog/" + this.liveId, res => {
        this.getLiveInfo()
      });
    },
    //加密引导添加
    addUserToSocailRoomByGuide() {
      let postData = {
        "isCombos": this.liveInfo.isBuyed == 1 && this.liveInfo.permissionType == 12 ? 61 : 0,
        "socialRoomId": this.liveInfo.jGRoomId,
        "refereeId": localStorage.getItem("refereeId")
      };
      utilJs.postMethod(global.apiurl + "social/addSocialRoom", postData, res => {
        this.addLivePlayLogByGuide()
      }, failRes => {
        isClicking = false;
      }
      );
    },
    liveRemind(isSet) {
      this.isSet = isSet
    },
    //免费+未开始预约进入直播
    goStartNockLiveRoom() {
      if (this.isSet == 1) {
        this.goLiveRoom()
      } else {
        this.$refs.liveDetailCover.startNock(1)
      }
    },
    //进入直播间
    goLiveRoom() {
      if (this.bindPhoneSetting && this.bindPhoneSetting.getBind) {
        if (utilJs.goBindMobile()) return;
      }
      if (this.liveInfo.liveType == 6 && this.liveInfo.moreTeacherType == 3 && this.liveInfo.pcLiveUrl) {
        this.showEnterPcTip = true;
        return;
      }
      let that = this;
      that.clickEnterRoom();
    },
    //添加直播记录
    addLivePlayLog() {
      return new Promise((resolve) => {
        utilJs.getMethod(global.apiurl + "liveFlow/addLivePlayLog/" + this.liveId, (res) => {
          console.log(11111111111111)
          resolve();
        });
      })
    },
    clickTryLook(info) {
      this.goLiveRoom()
      // if (this.bindPhoneSetting && this.bindPhoneSetting.getBind) {
      //   if (utilJs.goBindMobile()) return;
      // }
      // let roomInfo = info || this.liveInfo;
      // let recRelateId = this.recRelateId;
      // let recType = this.recType;
      // let queryObj = {
      //   liveId:this.liveId,
      //   SocialRoomId: roomInfo.jGRoomId,
      // }
      // if (this.goodsRoomId) {
      //   queryObj.goodsRoomId = this.goodsRoomId;
      // }
      // if (recRelateId) {
      //   queryObj.recRelateId = recRelateId;
      // }
      // if (recType) {
      //   queryObj.recType = recType;
      // }
      // sessionStorage.setItem("livePathFrom", "room")
      // this.$routerGo(this, "push", {
      //     path: "/homePage/live/liveVHTryRoom",
      //     query: queryObj,
      //   });

      },

    getRelatePackage() {
      let $this = this;
      utilJs.getMethod(global.apiurl + "combos/showRel?proId=" + this.lId + '&proType=8', function (res) {
        $this.packageList = res;
      });
    },

    //回退到上级(知识套餐),不支持单独售卖
    backPackage: function () {
      // if (this.liveInfo.liveType == 4 || this.liveInfo.liveType == 3) {
      //   this.$showCjToast({
      //     text: '语音直播，PPT直播正在维护，预计2月29号上线 ，如有需要，先用视频直播',
      //     type: 'warn'
      //   });
      //   return;
      // }
      if (pathFrom == "/homePage/column/columnDetail" || pathFrom == "/homePage/package/packageDetail") {
        this.$router.go(-1);
      } else {
        this.$routerGo(this, "push", {
          path: "/homePage/package/packageList",
          query: { noHighL: true, 'showAll': true, 'proType': 8, "proId": this.liveId }
        });
      }
    },

    // saveProgress: function () {
    //   let data = {
    //     prodId: liveId,
    //     prodType: 51,
    //     cId: "",
    //     progress: 1,
    //     duration: 0,
    //     cType: ""
    //   }
    //   let postUrl = `${global.apiurl}analysis/course/progressLog`;
    //   utilJs.postMethod(postUrl, data, res => { });
    // },
    //作为分享页被推荐人进入
    isRecommendPage() {
      let recRelateId = this.recRelateId; //推荐人ID
      let recType = this.recType; //推荐类型 1 访问 2 绑定 3 支付
      let bindPhone = this.$route.query.bindPhone; //完成推荐绑定手机号
      let data = { relateId: recRelateId };
      if (recRelateId) {
        if (recType == 1) {
          this.$nextTick(() => {
            this.$refs.recommendPresent.completetRecommendTask(data);
          })
          // this.completetRecommendTask(data);
        } else if (recType == 2) {
          if (bindPhone) {
            data.mobile = localStorage.getItem("uMobile");
            this.$nextTick(() => {
              this.$refs.recommendPresent.completetRecommendTask(data);
            })
            // this.completetRecommendTask(data);
          } else if (!localStorage.getItem("uMobile")) {
            utilJs.goBindMobile({
                recRelateId: recRelateId,
                recType: recType,
                goLive: 1,
                liveId: this.liveId,
                ckFrom: global.ckFrom.live
            });
          } else {
            this.$cjConfirm({
              title: '领取失败',
              message: '您已绑定过手机号，不在推荐范围，无法领取奖励',
              showCancelButton: false,
            })
          }
        }
      }
    },
    //分享
    wechatShare: function () {
      let title = this.liveInfo.shareTitle;
      let shareImg = this.liveInfo.sales ? this.liveInfo.sales.shareImg : this.liveInfo.sharePic;
      let shareUrl = `${window.location.href.split("#")[0]}#${this.$route.path}?liveId=${this.liveId}&refereeId=${localStorage.getItem("userId")}`;

      let shareDesc = this.liveInfo.liveBrief;
      if (this.liveInfo.sales) {
        title = `【限时抢购】${title}`;
      }
      if (this.liveInfo.bargain != null && ((this.liveInfo.bargain.status == 1 && this.liveInfo.bargain.isPreheat == 1) || this.liveInfo.bargain.status == 2)) {
        title = `【邀您一起砍价】${title}`;
      }
      if (this.companyAuth.enableFriendHelper == 1 && this.liveInfo.isFriendHelper == true) {
        title = `【快来帮我灌溉吧】${title}`;
      }
      let $this = this;
      utilJs.wechatConfig(shareUrl, title, shareImg, shareDesc, function () {
        $this.shareGetIntegration();
      });
    },
    //手机端分享
    appShare: function () {
      let title = this.liveInfo.shareTitle;
      let shareImg = this.liveInfo.sales ? this.liveInfo.sales.shareImg : this.liveInfo.sharePic;
      let shareUrl = `${window.location.href.split("#")[0]}#${this.$route.path}?liveId=${this.liveId}&refereeId=${localStorage.getItem("userId")}`;
      let shareDesc = this.liveInfo.liveBrief;
      if (this.liveInfo.sales) {
        title = `【限时抢购】${title}`;
      }
      if (this.liveInfo.bargain != null && ((this.liveInfo.bargain.status == 1 && this.liveInfo.bargain.isPreheat == 1) || this.liveInfo.bargain.status == 2)) {
        title = `【邀您一起砍价】${title}`;
      }
      if (this.companyAuth.enableFriendHelper == 1 && this.liveInfo.isFriendHelper == true) {
        title = `【快来帮我灌溉吧】${title}`;
      }
      utilJs.appShareTrue(title, shareImg, shareUrl, shareDesc);
    },
    async initData() {
      this.optimal = null;
      this.liveInfo = null;
      this.liveId = this.$route.query.liveId;
      this.goodsRoomId = this.$route.query.goodsRoomId || '';
      this.themeId = this.$route.query.themeId || '';
      this.tpId = this.$route.query.tpId || ''; //环节id
      this.ttId = this.$route.query.ttId || '';
      this.tlId = this.$route.query.tlId || '';
      this.ckFrom = this.$route.query.ckFrom || '';
      this.recType = this.$route.query.recType || 0;
      this.recRelateId = this.$route.query.recRelateId || "";
      this.lId = this.liveId;
      this.isOpenIosGzhPay = utilJs.isOpenIosGzhPay(global.ckFrom.live);
      this.isiOS = navigator.userAgent.indexOf("IOSLogin") > -1 || navigator.userAgent.indexOf('IOSNewLogin') > -1 || navigator.userAgent.indexOf("IOSNewApp") > -1;
      isClicking = false;
      this.detailTabList = [
          {
          title: "介绍",
          index: 4,
        }
      ];
      this.teacherList = [];
      this.signColumns = [];
      this.typeBar = 0
      this.showShareMoneyTip = true;
      this.packageList = [];
      this.cloroRGB = THEME_RGB_MAP[this.theme];
      this.faStatus = 1;
      this.couponPage = 1;
      this.couponIsPage = false;
      this.couponLoading = false;
      this.showCoupon = false;
      this.showEnterPcTip = false;
      this.couponList = [];
      this.showIntegrate = false; //获取积分提示
      this.integrateCount = 0;
      this.relateCollocation = [];
      this.showProcessBar = true;
      this.$loading.hide();
      this.recordingSetting = null;
      this.chainInfo = '';
      this.isChainProd = false;
      await utilJs.getScreenRecordingSetting().then(res => {
        this.recordingSetting = res;
      })
      getBindPhoneSetting(global.ckFrom.live).then(res => {
        this.bindPhoneSetting = res;
      });
      try {
        this.chainInfo = await utilJs.getChainInfo(global.ckFrom.live, this.liveId);
        this.isChainProd = this.chainInfo && this.chainInfo.isChainProd;
      } catch (error) {
        // 忽略错误
      }
      this.getLiveInfo(1);
    }
  },
  activated() {
    setDocumentTitle("直播详情");// eslint-disable-line
    this.initData();
  },
  deactivated() {
    this.showProtoIncome = false;
    this.$loading.hide();
    if (this.recordingSetting && this.recordingSetting.screenRecording == 1 && this.recordingSetting.ckApp == 0 && (utilJs.isAndroidApp() || utilJs.isIOSAppALL()) && ((this.recordingSetting.fitCourses == 1) || (this.liveInfo.isScreenRecordingCourse))) {
      utilJs.sendDataToAppWebview('restartScreenRecording')
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only  -->
<style scoped lang="scss">
.try-look-tag{
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-right: 0.3rem;
  width: 1.55rem;
  height: 0.7rem;
  border-radius: 0.1rem;
  background: rgba(222, 186, 131, 0.3);
  font-size: 0.45rem;
  color: #A0701C;
}
.border-r-lr20 {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}
.getIntegration {
  position: absolute;
  right: 0rem;
  top: 0.1rem;
  width: 3.75rem;
  height: 1.25rem;
  line-height: 1.25rem;
  border-top-left-radius: 0.625rem;
  border-bottom-left-radius: 0.625rem;
  background: rgba(255, 255, 255, 1);
  opacity: 0.9;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
.tabhBar /deep/ {
  padding-left:0.6rem;
  .tab-item {
    margin-right:1.2rem;
  }
}
.tabhBar /deep/ section{
  height: 2.1rem;
}
.tabhBar /deep/ .tab-icon{
  bottom: 0.355rem;
}
.tabhBar.one /deep/ section{
  padding:0 0 0 .6rem;
  justify-content: flex-start;
}
.tabhBar /deep/ .theme-bg{

}
.camp-guide {
  background: url("../../../assets/i/wap/course/group_guidance_bg.png") no-repeat;
  background-size: 100% 100%;
}
.closeBig >>> p > img,
.closeBig >>> section > img,
.closeBig >>> div > img,
.closeBig >>> img {
  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -o-user-select: none;
  user-select: none;
}
.aCloseBig >>> p > a > img,
.aCloseBig >>> section > a > img,
.aCloseBig >>> div > a > img {
  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -o-user-select: none;
  user-select: none;
}
.c-full-height /deep/ .vux-masker-fullscreen{
  height: 100%;
}
.teacher-info{
  background: #ffffff;
  margin-top: 1rem;

}
.teacher-info.has-intro{
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  min-height: 2.25rem;
  box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.1);
}
.teacher-info .item-avatar{
    position: relative;
    left:0.5rem;
}
.teacher-info.has-intro .item-avatar{
    position: absolute;
    left:0.5rem;
    right: 1rem;
    top:-0.75rem;
}
/deep/ .tabbar-wrap{

}
.fc-3F73F8 {
  color: #3F73F8;
}
.theme-live-room {
  .c-bg-xblue {
    background: var(--live-theme-color);
  }
}
.startbg{
  background:var(--live-theme-linearbg)
}
.promote-bg {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 5px 0 #0000001a;
}
.btn-wrap > div:first-child {
  color: #ff8831;
  color: var(--mb7color);
  background-color: rgba(255, 99, 45, 0.1);
  background-color: var(--rgba10color);
  border-bottom-left-radius: 0.9rem;
  border-top-left-radius: 0.9rem;
  border: 1px solid #ff8831;
  border: 1px solid var(--mb7color);
}
.btn-wrap > div:nth-child(2) {
  color: white;
  background-color: rgba(255, 99, 45, 0.5);
  background-color: var(--rgba50color);
  border-top: 1px solid #ff8831;
  border-top: 1px solid var(--mb7color);
  border-bottom: 1px solid #ff8831;
  border-bottom: 1px solid var(--mb7color);
}
.btn-wrap > div:last-child {
  color: white;
  background-color: #ff8831;
  background-color: var(--mb7color);
  border-bottom-right-radius: 0.9rem;
  border-top-right-radius: 0.9rem;
  border: none;
  border-top: none;
  border-bottom: none;
}
.theme-market .btn-wrap > div:first-child {
  background-color: var(--rgba10MarketColor);
  border: 1px solid var(--marketColor1);
  color: var(--marketColor1);
}
.theme-market .btn-wrap > div:nth-child(2) {
  background-color: var(--rgba50MarketColor);
  border-top: 1px solid var(--marketColor1);
  border-bottom: 1px solid var(--marketColor1);
  color: var(--marketColor1);
}
.theme-market .btn-wrap > div:last-child {
  background-image: -webkit-linear-gradient(0, var(--marketColor2) 0%, var(--marketColor1) 100%);
  color: #FFFFFF;
}
</style>
